Docs
On this page
reference3 min readApplication: Platform Integration

Create, update and delete records

POST, PUT, PATCH and DELETE requests of the REST API: URL forms, bodies, responses, status codes and validation errors.

POST creates records, PUT replaces a record, PATCH changes some fields of a record and DELETE removes one. This reference gives the URL, body and response of each method for developers who write to Servicely through the REST API.

Requests and status codes

Bodies are JSON with field names as keys. Each request runs as the authenticated user, so table permissions, field permissions, validation rules and triggers apply as they do in the product. A request that fails validation changes nothing.

Method URL Body
POST https://<instance>.servicely.ai/v1/<Table> One object, or an array of objects
PUT https://<instance>.servicely.ai/v1/<Table>/<id> One object with the complete record
PATCH https://<instance>.servicely.ai/v1/<Table>/<id> One object with the fields to change
DELETE https://<instance>.servicely.ai/v1/<Table>/<id> None
Status When
200 The record was created, updated or deleted
400 The body is not valid JSON, or the request failed for another reason. errors.request holds the message.
401 The request is not authenticated
404 No record has the ID in the URL
405 The method is not GET, POST, PUT, PATCH or DELETE
422 Validation failed. errors holds the messages, keyed by field name or table name.
501 A POST URL includes a record ID, or a PUT, PATCH or DELETE URL has none

The response to POST, PUT and PATCH holds the saved record in data, as a GET for that record would return it. The query parameters fields, displayValues and relations work on these responses too. See Query records and operators.

POST: create records

Send one object to create one record.

Request

POST /v1/Incident
Content-Type: application/json

{
    "ShortDescription": "Test incident",
    "AssignmentGroup": "00000000000000000000000000000010",
    "Classification": "00000000000000000000000000000100",
    "Requestor": "00000000000000000000000000000110",
    "RequestedFor": "00000000000000000000000000000110"
}

Response

HTTP/1.1 200 OK

{
    "data": {
        "AssignmentGroup": "00000000000000000000000000000010",
        "Classification": "00000000000000000000000000000100",
        "Closed": false,
        "Impact": "medium",
        "Number": "<number>",
        "ShortDescription": "Test incident",
        "WorkflowStatus": "new",
        "id": "00000000000000000000000000000111"
    }
}

Create several records

Send an array, or an object whose data key holds an array. Each object is created separately. The response data array holds one entry per object, in order, with its own status (200 or 422) and the saved record in data. One failing object does not stop the others.

Add allow_update=true to the URL to update instead of create when an object carries the id of an existing record.

POST /v1/User?allow_update=true
Content-Type: application/json

[
    { "id": "00000000000000000000000000000110", "Active": false },
    { "UserName": "new.user", "Email": "user@example.com" }
]

Validation errors

A validation failure returns 422. The key is the field that failed, or the table name when the operation as a whole was refused.

HTTP/1.1 422

{
    "errors": {
        "Email": [
            "<validation message>"
        ]
    }
}

PUT: replace a record

PUT makes the record match the body exactly. Every field you leave out is set to empty. System fields, system relations and managed fields are not affected.

Use PUT when another system is the authority for the record and Servicely must hold the same state, for example a user record synchronised from an HR system. Use PATCH when Servicely tracks fields the other system does not have.

Request

PUT /v1/User/00000000000000000000000000000110
Content-Type: application/json

{
    "Email": "user@example.com",
    "FirstName": "<first name>",
    "LastName": "<last name>",
    "Name": "<full name>",
    "UserName": "<user name>"
}

Response

HTTP/1.1 200 OK

{
    "data": {
        "Active": false,
        "Email": "user@example.com",
        "FirstName": "<first name>",
        "LastName": "<last name>",
        "Name": "<full name>",
        "TableClass": "User",
        "UserName": "<user name>",
        "id": "00000000000000000000000000000110"
    }
}

Active is false in the response because the body did not set it.

PATCH: update fields

PATCH changes only the fields in the body. Every other field keeps its value.

Request

PATCH /v1/User/00000000000000000000000000000110
Content-Type: application/json

{
    "Active": false,
    "LastName": "<new last name>"
}

Response

HTTP/1.1 200 OK

{
    "data": {
        "Active": false,
        "Email": "user@example.com",
        "LastName": "<new last name>",
        "UserName": "<user name>",
        "id": "00000000000000000000000000000110"
    }
}

DELETE: delete a record

DELETE removes the record with the ID in the URL. A successful delete returns 200 with an empty body. If a permission or a validation rule refuses the delete, the response is 422 with the reason in errors.

Request

DELETE /v1/User/00000000000000000000000000000110

Response

HTTP/1.1 200 OK
Content-Length: 0
Last updated 3 December 2026commit 6777698daac5Chris Jones
Back to top