Lookup tables

Use the following endpoints to manage lookup tables programmatically.

Rate limits

Lookup table resources have the following rate limits:

Quick reference

TypeResourceDescription
GET/api/lookup_tablesList tables.
GET/api/lookup_tables/:lookup_table_id/rowsList rows.
GET/api/lookup_tables/:lookup_table_id/lookupLook up a row.
GET/api/lookup_tables/:lookup_table_id/rows/:row_idGet a row.
POST/api/lookup_tables/:lookup_table_id/rowsAdd a row.
POST/api/lookup_tablesCreate a new lookup table.
POST/api/lookup_tables/batch_deleteDelete lookup tables in batch.
PUT/api/lookup_tables/:lookup_table_id/rows/:row_idUpdate a row.
DELETE/api/lookup_tables/:lookup_table_id/rows/:row_idDelete a row.

List lookup tables

Returns a list of lookup tables belonging to a customer. Workato includes the project_id of the project to which the lookup table belongs in the response.

GET /api/lookup_tables

Parameters

NameTypeDescription
pageintegerPage number. Defaults to 1.
per_pageintegerPage size. Defaults to 100 (maximum is 100).

Sample request

shell
curl  -X GET 'https://www.workato.com/api/lookup_tables' \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \

Response

json
[
  {
    "id": 1315,
    "name": "lookup_table4",
    "schema": 
    "[{\"control_type\":\"text\",\"label\":\"code\",\"name\":\"col1\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"name\",\"name\":\"col2\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"col3\",\"name\":\"col3\",\"type\":\"string\",\"sticky\":false},{\"control_type\":\"text\",\"label\":\"col4\",\"name\":\"col4\",\"type\":\"string\",\"sticky\":false},{\"control_type\":\"text\",\"label\":\"col5\",\"name\":\"col5\",\"type\":\"string\",\"sticky\":false}]",
    "created_at": "2022-05-20T11:54:26.934-07:00",
    "updated_at": "2022-05-20T11:54:26.934-07:00",
    "project_id": "523144"
  }
]

List rows

Returns a lists of rows from the lookup table. Supports filtering and pagination.

GET /api/lookup_tables/:lookup_table_id/rows

URL parameters

NameTypeDescription
lookup_table_idinteger
required
Lookup table id

Query parameters

NameTypeDescription
pageintegerPage number. Defaults to 1.
per_pageintegerPage size. Defaults to 500 (maximum is 1000).
by[<col name>]string
Filter criteria. The column name should be provided as follows: by[<col name>]. To match by multiple columns, provide multiple parameters. Refer to the sample request for more details. When not supplied, all rows are returned.

Sample request

Request 1: list rows

shell
curl  -X GET https://www.workato.com/api/lookup_tables/1296/rows \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json'

Request 2: filter and list rows

shell
curl  -X GET https://www.workato.com/api/lookup_tables/1296/rows?by[code]=US \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json'

Response

Response 1: list rows

json
[
      {
        "id": 941,
        "data": {
          "code": "IND",
          "name": "India",
          "col3": null,
          "col4": null,
          "col5": null
        },
        "created_at": "2022-06-15T11:50:32.986-07:00",
        "updated_at": "2022-06-15T11:50:40.986-07:00"
      },
      {
        "id": 942,
        "data": {
          "code": "US",
          "name": "United States",
          "col3": null,
          "col4": null,
          "col5": null
        },
        "created_at": "2022-05-20T11:50:32.986-07:00",
        "updated_at": "2022-05-20T11:50:40.986-07:00"
      }
]

Response 2: filter and list rows

json
[
      {
        "id": 942,
        "data": {
          "code": "US",
          "name": "United States",
          "col3": null,
          "col4": null,
          "col5": null
        },
        "created_at": "2022-05-20T11:50:32.986-07:00",
        "updated_at": "2022-05-20T11:50:40.986-07:00"
      }
]

Lookup a row

Finds the first row matching the given criteria in the lookup table. Returns a 404 when the lookup fails.

GET /api/lookup_tables/:lookup_table_id/lookup

URL parameters

NameTypeDescription
lookup_table_idinteger
required
Lookup table id

Query parameters

NameTypeDescription
by[<col name>]string
required
Lookup criteria. The column name should be provided as follows: by[<col name>]. To match by multiple columns, provide multiple parameters. Refer to the sample request for more details.

Sample request

shell
curl  -X GET https://www.workato.com/api/lookup_tables/1296/rows/942?by[code]=US \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json'

Response

json
{
  "id": 942,
  "data": {
    "code": "US",
    "name": "United States",
    "col3": null,
    "col4": null,
    "col5": null
  },
  "created_at": "2022-05-20T11:50:32.986-07:00",
  "updated_at": "2022-05-20T11:50:40.986-07:00"
}

Get a row

Get a row from the lookup table.

GET /api/lookup_tables/:lookup_table_id/rows/:row_id

URL parameters

NameTypeDescription
lookup_table_idinteger
required
Lookup table id
row_idinteger
required
Row id

Sample request

shell
curl  -X GET https://www.workato.com/api/lookup_tables/1296/rows/942 \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json'

Response

json
{
  "id": 942,
  "data": {
    "code": "US",
    "name": "United States",
    "col3": null,
    "col4": null,
    "col5": null
  },
  "created_at": "2022-05-20T11:50:32.986-07:00",
  "updated_at": "2022-05-20T11:50:40.986-07:00"
}

Add a row

Adds a row to the lookup table.

POST /api/lookup_tables/:lookup_table_id/rows

URL parameters

NameTypeDescription
lookup_table_idinteger
required
Lookup table id

Payload

NameTypeDescription
dataHash
required
The hash contains the data for the new row.

Sample request

shell
curl  -X POST https://www.workato.com/api/lookup_tables/1296/rows \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{ "data": { "name": "United States", "code": "USA" }}'

Response

json
{
  "id": 942,
  "data": {
    "code": "USA",
    "name": "United States",
    "col3": null,
    "col4": null,
    "col5": null
  },
  "created_at": "2022-05-20T11:50:32.986-07:00",
  "updated_at": "2022-05-20T11:50:32.986-07:00"
}

Create a new lookup table

Create a new lookup table. Depending on your requirements, you can choose to make the lookup table available for general access across your workspace or limit its scope to a specific project.

POST /api/lookup_tables

Payload

NameTypeDescription
namestring
required
Provide a name for your new lookup table.
project_idinteger
optional
Specify a project_id to scope the lookup table to a specific project. If you do not provide a project_id, the lookup table's scope is global.
Use the list projects API to obtain a list of projects in your workspace.
schemahash
required
Determine the structure of your lookup table by supplying a schema and specifying the name of each of the columns in your table, for example: [{ "label": "Name" }].
Lookup tables support a maximum of ten columns.

Sample request

shell
curl  -X POST https://www.workato.com/api/lookup_tables \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{
            "lookup_table": {
            "name": "Contacts",
            "project_id": 4321,
            "schema": [{ "label": "ID" }, { "label": "Name" }, {"label": "CSM"}, {"label": "Email"}, {"label": "Phone number"}, {"label": "Priority"}, {"label": "Tier"}, {"label": "Notes"}, {"label": "Created at"}, {"label": "Updated at"}]
            }
          }'

Response

json
{
    "id": 2372,
    "name": "Contacts",
    "schema": "[{\"control_type\":\"text\",\"label\":\"ID\",\"name\":\"col1\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Name\",\"name\":\"col2\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"CSM\",\"name\":\"col3\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Email\",\"name\":\"col4\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Phone number\",\"name\":\"col5\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Priority\",\"name\":\"col6\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Tier\",\"name\":\"col7\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Notes\",\"name\":\"col8\",\"type\":\"string\",\"sticky\":true},{\"control_type\":\"text\",\"label\":\"Created at\",\"name\":\"col9\",\"type\":\"string\",\"sticky\":false},{\"control_type\":\"text\",\"label\":\"Updated at\",\"name\":\"col10\",\"type\":\"string\",\"sticky\":false}]",
    "project_id": 4321,
    "created_at": "2023-09-11T11:31:35.335-07:00",
    "updated_at": "2023-09-11T11:31:35.335-07:00"
}

Delete lookup tables in batch

Use this endpoint to delete lookup tables in batch.

POST /api/lookup_tables/batch_delete

Payload

NameTypeDescription
idshash
required
Include the ID(s) of the lookup table(s) you plan to delete.

Sample request

shell
curl  -X POST https://www.workato.com/api/lookup_tables/batch_delete \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{ "ids": [1234, 1235, 1236] }'

Response

json
{
    "data": {"deleted": [1234, 1235, 1236] },
    "errors": []
}

Update a row

Updates a row in the lookup table.

PUT /api/lookup_tables/:lookup_table_id/rows/:row_id

URL parameters

NameTypeDescription
lookup_table_idinteger
required
Lookup table id
row_idinteger
required
Row id

Payload

NameTypeDescription
dataHash
required
The hash containing the data for the updated row. Only the columns provided are updated.

Sample request

shell
curl  -X PUT https://www.workato.com/api/lookup_tables/1296/rows/942 \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json' \
      -d '{ "data": { "code": "US" }}'

Response

json
{
  "id": 942,
  "data": {
    "code": "US",
    "name": "United States",
    "col3": null,
    "col4": null,
    "col5": null
  },
  "created_at": "2022-05-20T11:50:32.986-07:00",
  "updated_at": "2022-05-20T11:50:40.986-07:00"
}

Delete a row

Delete a row from the lookup table

DELETE /api/lookup_tables/:lookup_table_id/rows/:row_id

URL parameters

NameTypeDescription
lookup_table_idinteger
required
Lookup table id
row_idinteger
required
Row id

Sample request

shell
curl  -X DELETE https://www.workato.com/api/lookup_tables/1296/rows/942 \
      -H 'Authorization: Bearer <api_token>' \
      -H 'Content-Type: application/json'

Response

json
{
  "success": true
}

Last updated: