Responses and errors

The shape of a response, and the status codes

  1. Responses
  2. Status codes

Responses are plain JSON, and the HTTP status code tells whether a call succeeded.

Responses

A successful call returns the object itself, or a list with its size:

{ "count": 2, "records": [ { "id": 41 }, { "id": 42 } ] }

An error returns a message, and details when there are any:

{ "error": "The form data is not valid", "details": [ ... ] }

Status codes

The status code tells what went wrong:

Code Meaning
200 The call succeeded
401 The token is missing, wrong or expired: log in or refresh it
403 The user’s roles do not allow the call
404 The object does not exist
409 The request is incomplete, for example a launch without data
422 Launch validation refused the form’s values; details lists why
500 The server failed; the server log has the reason

Copyright © 2023-2026 AnsibleForms. All rights reserved.

This site uses Just the Docs, a documentation theme for Jekyll.