Sessions

Sessions wrap individual workflows within Selectify. They tie a series of different pages and selector queries together. In an integration test, they correspond to one run of an integration test.

In this section, we will explore the various endpoints related to managing sessions programmatically. You'll learn how to initiate, monitor, and conclude sessions, as well as manage their attributes and related actions.


Create a session

This endpoint allows you to create a new session, which should house one given workflow's worth of query selectors.

Header Values

  • Name
    authorization
    Type
    Description

Request Body

Requests should be formatted as a SessionCreate object.

  • Name
    workflow_name
    Type
    string
    Description
    The machine-name of the workflow.
  • Name
    is_training
    Type
    boolean
    Description
    Whether or not this session is a training session.

Response Body

Responses will be formatted as a Session object.

  • Name
    id
    Type
    string
    Description
  • Name
    session_name
    Type
    string
    Description
    The machine-name of the session.
  • Name
    is_training
    Type
    boolean
    Description
    Whether or not this session is a training session.
  • Name
    workflow_id
    Type
    string
    Description
    The workflow that this session belongs to.

Request

curl -X POST "https://api.selectify.ai/session" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"\
  -d '{
    "workflow_name": "string",
    "is_training": false
  }'

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "session_name": "string",
  "is_training": false,
  "workflow_id": "00000000-0000-0000-0000-000000000000"
}

Retrieve a session

This endpoint allows you to retrieve the details about a given session.

URL Parameters

  • Name
    session_id
    Type
    string
    Description

Header Values

  • Name
    authorization
    Type
    Description

Response Body

Responses will be formatted as a Session object.

  • Name
    id
    Type
    string
    Description
  • Name
    session_name
    Type
    string
    Description
    The machine-name of the session.
  • Name
    is_training
    Type
    boolean
    Description
    Whether or not this session is a training session.
  • Name
    workflow_id
    Type
    string
    Description
    The workflow that this session belongs to.

Request

curl -X GET "https://api.selectify.ai/session/{session_id}" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "session_name": "string",
  "is_training": false,
  "workflow_id": "00000000-0000-0000-0000-000000000000"
}

Ping a session

This endpoint allows you to ping the server to indicate that the session is not yet complete. When the server hasn't received an updated ping for some interval, we'll assume that your pipeline quit and the session is closed.

URL Parameters

  • Name
    session_id
    Type
    string
    Description

Header Values

  • Name
    authorization
    Type
    Description

Request

curl -X POST "https://api.selectify.ai/session/{session_id}/ping" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"\
  -d '{}'

End a session

This endpoint allows you to explicitly end a session. Ended sessions can't be re-started.

URL Parameters

  • Name
    session_id
    Type
    string
    Description

Header Values

  • Name
    authorization
    Type
    Description

Request

curl -X POST "https://api.selectify.ai/session/{session_id}/end" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"\
  -d '{}'