Fields

Update Field By 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": ""
 }
}

Who can update a field

Anyone in your company can update any field in it. The endpoint scopes the write to your company, not to the person who created the field.

Sending the id in the body

You can also send PUT {{url}}/v1/fields with the field id in the request body instead of the path. Both forms run the same handler. Send the id in both places and the path value wins. Send it in neither and the request returns 400.

Errors

  • 400 when no field id reaches the endpoint, in either the path or the body.
  • 404 when your company has no field with that id.
  • 409 when you change name to one that another field in your company already uses.
put/fields/{id}

Request

  • Base URL: https://api.speakai.co/v1
  • URL: https://api.speakai.co/v1/fields/{id}
  • Auth: API key in header x-speakai-key and API key in header x-access-token

Path parameters

idstring required

Request body

idstring

Identify the field to update. Optional here, because the path already carries the id. Trimmed. Send it in the body when you call PUT /fields with no id in the path. When you send both, the path value wins.

namestring required

Set the field name. You have to send this key on every update, even when the name is not changing. Required, and an empty string is accepted. Unlike the create schema this one does not trim. When the name differs from the stored one the server checks for another field with that name in your company and returns 409 if it finds one.

descriptionstring

Set what the field is for. You can send an empty string. Optional. Empty string is accepted. Not trimmed.

privacyMode'public' | 'private'

Choose whether values for this field are visible publicly or kept private. Optional. Trimmed. The schema schema writes.allow(MediaPrivacyMode), which does not constrain the string, so the validator accepts any non-empty string. The stored record enforces the list.

type'text' | 'url' | 'boolean' | 'date' | 'datetime' | 'number' | 'currency'

Change the data type the field stores. Optional. Trimmed. Same.allow(FieldType) pattern, so the validator accepts any non-empty string and the model enforces the list.

promptstring

Give the AI an instruction for filling this field automatically. Optional. Trimmed. Empty string is accepted.

allowedValuesstring[]

Replace the list of values a user can pick for this field. Optional. Every item must be a string. No cap on the number of items.

allowedValuesMode'single' | 'multiple'

Choose whether a user can pick one value from allowedValues or several. Optional. Enforced by the schema with.valid(.Object.values(AllowedValuesMode)), so anything outside the list returns 400. No default on the update schema.

otherValuesboolean

Allow a user to enter a value that is not in allowedValues. Optional.

notApplicableValuesstring

Set the text that marks this field as not applicable for a piece of media. Optional. Empty string is accepted.

Response

Success

Changes

No recorded changes to this operation across all 2 revisions of this API.