Skip to content

Attach custom fields to your Speak AI media records

Create custom fields in Speak AI, list every field defined in your account, and update a single field or a whole batch of fields in one request.

Updated View as MarkdownAsk ClaudeOpen in ChatGPTllms.txt

The Speak AI API exposes 4 fields endpoints under the base URL https://api.speakai.co/v1. Every request needs the x-speakai-key and x-access-token headers described in Authentication.

Manage Fields.

What can you do with the fields endpoints?

Speak AI groups these 4 endpoints under the fields resource. Each entry below links to the full reference for that endpoint further down this page.

Get All Fields

GET/fields

Retrieve Fields

This endpoint makes an HTTP GET request to retrieve a list of fields.

Request

The request does not require a request body. It simply makes a GET request to the endpoint https://api.speakai.co/v1/fields.

Response

The response will be a JSON object representing the list of fields. Below is a JSON schema representing the structure of the response:

{
  "type": "object",
  "properties": {
    "fields": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "fieldId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "description": {
            "type": "string"
          }
        }
      }
    }
  }
}

The fields array contains objects with fieldId, name, type, and description properties, representing the details of each field.

Example request
curl -X GET 'https://api.speakai.co/v1/fields' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000'
Response

200 Success

The spec records this status code with no example body.

Create Field

POST/fields

Add Field

This endpoint allows you to add a new field.

Request Body
  • description (string, required): A description of the field.

  • name (string, required): The name of the field.

  • type (string, required): The type of the field.

  • privacyMode (string, required): The privacy mode of the field. “public” or “private”.

Response

The response will contain the details of the newly added field.

Request body

Field types and names come from the request body the spec records. The spec does not mark request body fields as required, so read this as the shape the endpoint accepts rather than a required field list.

Field Type
description string
name string
type string
privacyMode string
Example request
curl -X POST 'https://api.speakai.co/v1/fields' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "Currency",
  "name": "Currency",
  "type": "currency",
  "privacyMode": "public"
}'
Response

200 Success

The spec records this status code with no example body.

Update Field By Id

PUT/fields/{id}

Update Field Information

This endpoint allows you to update the information of a specific field.

Request Body
  • description (string, required): The updated description of the field.

  • name (string, required): The new name of the field.

Example:

{
    "description": "Currency Description Updated",
    "name": "New Updated Name",
    "privacyMode": "public"
}
Response
  • status (string): The status of the response.

  • data (object): An object containing the updated field information.

    • id (string): The ID of the field.

    • name (string): The name of the field.

    • description (string): The description of the field.

    • type (string): The type of the field.

    • isActive (boolean): Indicates if the field is active.

    • privacyMode (string): The privacy mode of the field.

    • createdAt (string): The date and time of creation.

    • updatedAt (string): The date and time of the last update.

Example Response:

{
    "status": "",
    "data": {
        "id": "",
        "name": "",
        "description": "",
        "type": "",
        "isActive": true,
        "privacyMode": "",
        "createdAt": "",
        "updatedAt": ""
    }
}

Parameters

Parameter In Type Required Description
id path string Yes

Request body

Field types and names come from the request body the spec records. The spec does not mark request body fields as required, so read this as the shape the endpoint accepts rather than a required field list.

Field Type
description string
name string
privacyMode string
Example request
curl -X PUT 'https://api.speakai.co/v1/fields/0172d3abbdd1' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000' \
  -H 'Content-Type: application/json' \
  -d '{
  "description": "Currency Description Updated",
  "name": "New Updated Name",
  "privacyMode": "public"
}'
Response

200 Success

The spec records this status code with no example body.

Update Multiple Fields

POST/fields/batch

Set custom field values across media. Scope with folderId (all media in a folder) and/or mediaIds (specific files). Each fields entry is { id, value }.

Request body

Field types and names come from the request body the spec records. The spec does not mark request body fields as required, so read this as the shape the endpoint accepts rather than a required field list.

Field Type
folderId string
mediaIds string[]
fields object[]
fields[].id string
fields[].value string
Example request
curl -X POST 'https://api.speakai.co/v1/fields/batch' \
  -H 'x-speakai-key: sk_test_speak_0000000000000000' \
  -H 'x-access-token: eyJhbGciOiJIUzI1NiJ9.test-access-token.0000000000' \
  -H 'Content-Type: application/json' \
  -d '{
  "folderId": "your_folder_id_here",
  "mediaIds": [
    "your_media_id_here"
  ],
  "fields": [
    {
      "id": "your_field_id_here",
      "value": "The value you want to set"
    }
  ]
}'
Response

200 Success

The spec records this status code with no example body.

Get an API key on the Speak AI developer page.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close