Skip to main content
POST
/
v1
/
api-keys
/
create
Create a new API access key
curl --request POST \
  --url https://app.textql.com/v1/api-keys/create \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "hosts": [
    "<string>"
  ],
  "headers": {},
  "queryParams": {},
  "description": "<string>",
  "expiresAt": "2023-11-07T05:31:56Z",
  "isPrivate": true,
  "provider": "<string>",
  "authValue": "<string>",
  "authValueExtra": "<string>",
  "authType": "<string>"
}
'
{
  "apiAccessKey": {
    "id": "<string>",
    "orgId": "<string>",
    "memberId": "<string>",
    "hosts": [
      "<string>"
    ],
    "headers": {},
    "queryParams": {},
    "description": "<string>",
    "createdAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z",
    "expiresAt": "2023-11-07T05:31:56Z",
    "provider": "<string>",
    "authType": "<string>",
    "memberOauthAuthenticated": true,
    "memberOauthDisplayName": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
hosts
string[]

List of host URLs this key is authorized to access

headers
headers · object

Custom headers to include with requests

queryParams
query_params · object

Custom query parameters to include with requests

description
string
expiresAt
string<date-time>

RFC 3339 timestamp format (e.g., "2024-12-25T12:00:00Z")

Examples:

"2023-01-15T01:30:15.01Z"

"2024-12-25T12:00:00Z"

isPrivate
boolean

When true, only the creating member can view and manage this key. When false (default), the key is visible to all members in the organization.

provider
string

The API provider identifier (e.g., "openai", "anthropic")

authValue
string

The token or key value for the provider

authValueExtra
string

Extra auth value (e.g., email for basic_auth)

authType
string

Authentication type: "token" (default), "oauth_u2m", "oauth_per_member"

Response

Success

apiAccessKey
api_access_key · object