Token

Manage Tokens

Listing tokens

get

Retrieves tokens based on the provided query.

Required scopes

  • ai.agent_read

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

Query parameters
qstringOptional

A standard query parameter is used to search for specific values.

See: Standard Practices - Query parameter

pageSizestringOptional

The number of documents to be retrieved per page.

pageNumberstringOptional

The page number to be retrieved. The size of the pages should be specified by the pageSize parameter.

sortstringOptional

List of properties used to sort the results, separated by colons.

fieldsstringOptional

Fields to be returned in the response.

Header parameters
X-Total-CountbooleanOptional

Flag indicating whether the total number of retrieved results should be returned.

Responses
200

List of tokens.

application/json
get
/ai-service/{tenant}/agentic/tokens
GET /ai-service/{tenant}/agentic/tokens HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "id": "emporix--openai",
    "name": "Emporix OpenAi Token"
  },
  {
    "id": "openai",
    "name": "OpenAi Token"
  }
]

Searching tokens

post

Searches for tokens based on the provided query.

Required scopes

  • ai.agent_read

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

Query parameters
pageSizestringOptional

The number of documents to be retrieved per page.

pageNumberstringOptional

The page number to be retrieved. The size of the pages should be specified by the pageSize parameter.

sortstringOptional

List of properties used to sort the results, separated by colons.

fieldsstringOptional

Fields to be returned in the response.

Header parameters
X-Total-CountbooleanOptional

Flag indicating whether the total number of retrieved results should be returned.

Body
qstringOptional

A standard query parameter is used to search for specific values.

See: Standard Practices - Query parameter

Responses
200

List of tokens.

application/json
post
/ai-service/{tenant}/agentic/tokens/search
POST /ai-service/{tenant}/agentic/tokens/search HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 21

{
  "q": "name:~Support"
}
[
  {
    "id": "emporix--openai",
    "name": "Emporix OpenAi Token"
  },
  {
    "id": "openai",
    "name": "OpenAi Token"
  }
]

Retrieving token by ID

get

Retrieves the token by given ID.

Required scopes

  • ai.agent_read

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

tokenIdstringRequired
Query parameters
fieldsstringOptional

Fields to be returned in the response.

Responses
200

A single token.

application/json
Responseall of
get
/ai-service/{tenant}/agentic/tokens/{tokenId}
GET /ai-service/{tenant}/agentic/tokens/{tokenId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
{
  "id": "openai",
  "name": "OpenAi Token"
}

Upserting token

put

Updates or creates a specified token by replacing all of its existing data with data from the request body. If the metadata.version is provided then optimistic locking is enabled and version must match the version in the database.

Important: The value field cannot be updated, once created token cannot change value field.

Required scopes

  • ai.agent_manage

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

tokenIdstringRequired
Body
all ofOptional
Responses
201

ID of created token.

application/json
put
/ai-service/{tenant}/agentic/tokens/{tokenId}
PUT /ai-service/{tenant}/agentic/tokens/{tokenId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 43

{
  "name": "OpenAI Token",
  "value": "sk-secret"
}
{
  "id": "a81bc81b-dead-4e5d-abff-90865d1e13b1"
}

Deleting token

delete

Deletes tokens by given ID.

Important: If token is being used by an agent or by an mcp server then delete operation is not possible without force flag set to true.

Required scopes

  • ai.agent_manage

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

tokenIdstringRequired
Query parameters
forcebooleanOptional

Allows you to remove a given entity even if it is used as a dependency in other entries. In that case, the removed entity is unassigned from other entries.

Example: false
Responses
204

Given token has been deleted.

No content

delete
/ai-service/{tenant}/agentic/tokens/{tokenId}
DELETE /ai-service/{tenant}/agentic/tokens/{tokenId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*

No content

Partially updating token

patch

Partially updates a single token document with given information. Single update may contain multiple partial updates in the form of an array. It contains the allowed operations list:

  • add (adding an item to the items list)

  • remove (removing an item from the items list)

  • replace (replacing an item with given ID with new definition)

Important: The value field cannot be updated, once created token cannot change value field.

Required scopes

  • ai.agent_manage

Authorizations
Path parameters
tenantstringRequired

Your Emporix tenant name.

Note: The tenant name should always be provided in lowercase.

tokenIdstringRequired
Bodyobject[]

Partial update operation list.

opany ofRequired
undefined · enumOptionalPossible values:
pathstringRequiredExample: /name
valueany ofOptional
stringOptional

Value of the string type.

or
objectOptional

Any part of the details object.

Responses
204

No Content

No content

patch
/ai-service/{tenant}/agentic/tokens/{tokenId}
PATCH /ai-service/{tenant}/agentic/tokens/{tokenId} HTTP/1.1
Host: api.emporix.io
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 60

[
  {
    "op": "REPLACE",
    "path": "/name",
    "value": "New OpenAI Token"
  }
]

No content

Last updated

Was this helpful?