authed

Create a publishable key

Create a publishable key for one of this organization's agents — its turns run that agent's published revision. The response carries the full key, and so does every later listing: a publishable key is public, so it is always copyable.

post/api/v1/serving-identity/keys

Request

  • Base URL
    https://api.teaflask.com (the document declares no server; this is the origin it was published from)
  • URL
    https://api.teaflask.com/api/v1/serving-identity/keys
  • Auth
    none declared

Request body

mode'live' | 'test' required
allowed_originsstring[] required

Every web origin the assistant will run on, scheme and host only, like https://app.example.com or http://localhost:3000. They can't be changed after the key is created, so include local, staging and production origins now.

agent_definition_idstring uuid required

The agent the key serves. The assistant answers only once that agent has a published version.

Response

Successful Response

idstring uuid required

The key's id.

key_prefixstring required

The key's first characters, to recognize it.

keystring required

The full publishable key, safe in page source: it names the organization and agent, and grants nothing on its own.

mode'live' | 'test' required
allowed_originsstring[] required

The only web origins the key answers requests from. Fixed when the key is created.

status'active' | 'revoked' required
revoked_atstring date-time nullable required

When the key was revoked; null while it is active.

last_used_atstring date-time nullable required

When a visitor last started a session with the key; null until the assistant is first opened with it.

created_atstring date-time required

When the key was created.

agent_definition_idstring uuid nullable required

The agent this key serves: conversations started with it run that agent's published version.

Changes

No recorded changes to this operation across all 1 revision of this API.