Table of contents

Custom Fields API

The Custom Fields API is a way to attach custom data to items. This API provides means to manage your custom fields.

Listing custom fields

GET /api/data/v3/fields?page-token={page-token}&limit={limit}

Optional Query Parameters:

  • page-token - (string) A page token to fetch an additional or previous page of results
  • limit - (int) How many results to return. Minimum: 1, Maximum: 1000, Default: 20

Response:

{
    "fields": [
        {
            "id": "5de700b219b0e84945469242fa23b6f4",
            "name": "thename",
            "description": "some description",
            "data_type": "string",
            "created_at": "2019-12-04T00:41:22.416234Z",
            "updated_at": "2019-12-04T00:41:22.416234Z"
        }
    ],
    "next_page": "",
    "previous_page": ""
}
  • fields - (array) An array of field objects:
    • id - (string) The id of the field
    • name - (string) The name of the field
    • description - (string) The description of the field
    • data_type - (string) The data type of the field
    • created_at - (string) The timestamp when the field was created
    • updated_at - (string) The timestamp when the field was last updated
  • next_page - A page token that can be used to retrieve the next page of fields. If this is an empty string, there are no additional results to return.
  • previous_page - A page token that can be used to retrieve the previous page of fields. If this is an empty string, there are no earlier results available.

Status codes:

  • 200 (success)
  • 500 (unexpected error)

Creating a new field

POST /api/data/v3/fields
{
    "description": "The description",
    "name": "The name",
    "data_type": "string"
}
  • name - (string) The name of the field
  • description - (string) The description of the field
  • data_type - (string) The data type of the field. One of bool, date, number, string

Response:

{
    "id": "5de700b219b0e84945469242fa23b6f4",
    "name": "thename",
    "description": "some description",
    "data_type": "string",
    "created_at": "2019-12-04T00:41:22.416234Z",
    "updated_at": "2019-12-04T00:41:22.416234Z"
}
  • id - (string) The id of the field
  • name - (string) The name of the field
  • description - (string) The description of the field
  • data_type - (string) The data type of the field
  • created_at - (string) The timestamp when the field was created
  • updated_at - (string) The timestamp when the field was last update

Status codes:

  • 201 (success)
  • 500 (unexpected error)

Updating a field

PATCH /api/data/v3/fields/{id}
{
    "description": "The description",
    "name": "The name",
}
  • name - (string) Optional. The name of the field
  • description - (string) Optional. The description of the field

NOTE: Only the name and description of a field are mutable.

Response:

{
    "id": "5de700b219b0e84945469242fa23b6f4",
    "name": "thename",
    "description": "some description",
    "data_type": "string",
    "created_at": "2019-12-04T00:41:22.416234Z",
    "updated_at": "2019-12-04T00:41:22.416234Z"
}
  • id - (string) The id of the field
  • name - (string) The name of the field
  • description - (string) The description of the field
  • data_type - (string) The data type of the field
  • created_at - (string) The timestamp when the field was created
  • updated_at - (string) The timestamp when the field was last update

Status codes:

  • 200 (success)
  • 500 (unexpected error)

Getting a specific field

GET /api/data/v3/fields/{id}

Response:

{
    "id": "5de700b219b0e84945469242fa23b6f4",
    "name": "thename",
    "description": "some description",
    "data_type": "string",
    "created_at": "2019-12-04T00:41:22.416234Z",
    "updated_at": "2019-12-04T00:41:22.416234Z"
}
  • id - (string) The id of the field
  • name - (string) The name of the field
  • description - (string) The description of the field
  • data_type - (string) The data type of the field
  • created_at - (string) The timestamp when the field was created
  • updated_at - (string) The timestamp when the field was last update

Status codes:

  • 200 (success)
  • 404 (field not found)
  • 500 (unexpected error)

Deleting a field

DELETE /api/data/v3/fields/{id}

Status codes:

  • 200 (success)
  • 500 (unexpected error)

This documentation is generated from the latest version of GrayMeta Platform. For documentation relevant to your own deployed version, please use the documentation inside the application.