Table of contents
Official Content
  • This documentation is valid for:

This API provides endpoints to retrieve organization data, such as projects and requests. It allows you to fetch project details and export request data.

Check the generic variables needed to use the API.

Endpoints

Below is a summary of the available endpoints for this API:

Method  Path Description
GET /assistants Gets the list of assistants
GET /projects Gets the list of projects
GET /project/{id} Gets project details
POST /project Creates a project
PUT /project/{id} Updates a project
DELETE /project/{id} Deletes a project
GET /project/{id}/tokens Gets the list of Tokens for the project
GET /request/export Exports request data

 

Note: Keep in mind that the searchProfiles parameter refers to RAG Assistants.

GET/assistants

Gets a list of assistants.

This endpoint requires a Globant Enterprise AI API token related to organization scope.

Parameters

Name  Type Description
detail string Defines the level of detail required. The available options are summary (default) or full (optional).

Response

Using the default summary option will only show the first level. The full option will display revision detail and assistant composition:

{
  "assistants": [
    {
      "assistantId": "string",
      "assistantName": "string",
      "intents": [ /* full option */
        {
          "assistantIntentDefaultRevision": "number",
          "assistantIntentDescription": "string",
          "assistantIntentId": "string",
          "assistantIntentName": "string",
          "revisions": [
            {
              "metadata": [
                {
                  "key": "string",
                  "type": "string",
                  "value": "string"
                },
                ...
              ],
              "modelId": "string",
              "modelName": "string",
              "prompt": "string",
              "providerName": "string",
              "revisionDescription": "string",
              "revisionId": "string",
              "revisionName": "string",
              "timestamp": "timestamp"
            },
            ...
          ]
        }
      ]
    },
    ...
  ],
  "projectId": "string",
  "projectName": "string"
}

cURL Sample

curl -X GET "$BASE_URL/v1/organization/assistants" \
  -H "Authorization: Bearer $SAIA_PROJECT_APITOKEN" \
  -H "Accept: application/json"
# using the full detail option change the URL to
$BASE_URL/v1/organization/assistants?detail=full

Keep an eye on the returned assistantId element that is needed for other related APIs.

GET/projects

Gets a list of projects.

This endpoint requires a Globant Enterprise AI API token related to organization scope.

Parameters

Name  Type Description
detail string Defines the level of detail required. The available options are summary (default) or full (optional).
name string Searches by project name (equals) (optional)

Active projects will be listed by default. To list all projects, use the full detail option.

Response

{
  "projects": [
    {
      "projectActive": "boolean",
      "projectDescription": "string",
      "projectId": "string",
      "projectName": "string",
      "projectStatus": "integer", /* 0:Active, 2:Hidden */
    },
    ...
  ]
}

cURL Sample

curl -X GET "$BASE_URL/v1/organization/projects" \
  -H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
  -H "Accept: application/json"
# using the full detail option change the URL to
$BASE_URL/v1/organization/projects?detail=full
# using the name option filter change the URL to
$BASE_URL/v1/organization/projects?name=projectName

Keep an eye on the returned projectId item value that is needed for other related APIs.

GET /project/{id}

Gets project {id} details.

This endpoint can be used whether the Globant Enterprise AI API token is related to the organization scope or to the project scope.

Parameters

Name  Type Description
id string GUID (required)

Response

{
  "organizationId": "string",
  "organizationName": "string",
  "projectActive": "boolean",
  "projectDescription": "string",
  "projectId": "string",
  "projectName": "string",
  "projectStatus": "integer", /* 0:Active, 2:Hidden */
  "searchProfiles": [
    {
      "name": "string",
      "description": "string"
    },
      ...
  ]
}

cURL Sample

curl -X GET "$BASE_URL/v1/organization/project/{id}" \
 -H "Authorization: Bearer $SAIA_APITOKEN" \
 -H "accept: application/json"

POST/project

Creates a new project.

This endpoint requires a Globant Enterprise AI API token related to organization scope.

Request Body

{
  "Name": "string",
  "Description": "string"
  "administratorUserEmail": "mail@domain.com"
}

Note that the administratorUserEmail parameter can only be used if the Migration to the new Roles and Permissions Management System has been completed.

Response

{
  "projectActive": "boolean",
  "projectDescription": "string",
  "projectId": "string",
  "projectName": "string",
  "projectStatus": "integer", /* 0:Active, 2:Hidden */
  "searchProfiles": [
    {
      "name": "string",
      "description": "string"
    },
    ...
  ],
  "tokens": [
    {
      "description": "string",
      "id": "string",
      "name": "string",
      "status": "string", /* Active, Blocked */
      "timestamp": "timestamp"
    },
    ...
  ]
}

Note that token elements (default API Tokens) are only returned at Project creation time. You can retrieve them using the GET Tokens endpoint.

When the creation is not successful, StatusCode 400* will be shown with a collection of errors:

{
  "errors": [
    {
      "id": "integer",
      "description": "string"
    },
    ...
  ]
}

cURL Sample

curl -X POST "$BASE_URL/v1/organization/project" \
 -H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
 -H "accept: application/json" \
 -d '{
      "name": "my Project",
      "description": "My awesome project"
      "administratorUserEmail": "myemail@globant.com"
 }'

PUT/project/{id}

Updates a project.

This endpoint requires a Globant Enterprise AI API token related to organization scope.

Parameters

Name  Type Description
id string GUID ProjectId (required)

Request Body

{
  "name": "string", /* Required */
  "description": "string"
}

Response

{
  "projectActive": "boolean",
  "projectDescription": "string",
  "projectId": "string",
  "projectName": "string",
  "projectStatus": "integer", /* 0:Active, 2:Hidden */
  "searchProfiles": [
    {
      "name": "string",
      "description": "string"
    },
    ...
  ]
}

When the creation is not successful, StatusCode 400* will be shown with a collection of errors.

cURL Sample

curl -X PUT "$BASE_URL/v1/organization/project/{id}" \
 -H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
 -H "accept: application/json" \
 -d '{
  "name":"Sample Project",
  "description":"sample project description updated"
}'

DELETE /project/{id}

Deletes a project.

This endpoint requires a Globant Enterprise AI API token related to organization scope.

Parameters

Name  Type Description
id string GUID ProjectId (required)

Response

StatusCode 200 is shown when successfully deleted; otherwise, 400* is displayed with a collection of errors.

cURL Sample

curl -X DELETE "$BASE_URL/v1/organization/project/{id}" \
 -H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
 -H "accept: application/json"

GET /project/{id}/tokens

Gets the list of API tokens for the {id} project.

This endpoint requires a Globant Enterprise AI API token related to organization scope.

Parameters

Name  Type Description
id string Project GUID (required)

Response

{
  "tokens": [
    {
      "description": "string",
      "id": "string",
      "name": "string",
      "status": "string", /* Active, Blocked */
      "timestamp": "timestamp"
    },
    ...
  ]
}

cURL Sample

curl -X GET "$BASE_URL/v1/organization/project/{id}/tokens" \
 -H "Authorization: Bearer $SAIA_ORGANIZATION_APITOKEN" \
 -H "accept: application/json"

GET /request/export

Exports request data.

This endpoint requires a Globant Enterprise AI API token related to project scope.

Parameters

Name  Type Description
assistantName string Assistant name (optional)
status string Status (optional)
skip integer Number of entries to skip
count integer Number of entries to retrieve

Response

{
  "items": [
    {
      "assistant": "string",
      "intent": "string",
      "timestamp": "string",
      "prompt": "string",
      "output": "string",
      "inputText": "string",
      "status": "string"
    },
    ...
  ]
}

cURL Sample

curl -X GET "https://api.saia.ai/v1/organization/request/export?assistantName=example&status=succeeded" \
  -H "Authorization: Bearer $SAIA_PROJECT_APITOKEN" \
  -H "Accept: application/json"

 

Last update: September 2024 | © GeneXus. All rights reserved. GeneXus Powered by Globant