REST API

Launch forms and manage AnsibleForms from scripts


For developers and automation engineers: launch forms and manage AnsibleForms from scripts.

Everything the web interface does goes through the REST API, so scripts and other tools can do the same.


Overview

The API is served under /api/v2 on the AnsibleForms server:

  • Full reference : these pages cover what scripts use most. Every endpoint is described, and can be tried, on the server’s built-in Swagger page, https://<your server>/api/v2/docs.
  • Permissions : a call runs as the user whose token it carries, with that user’s roles, as in the browser.
  • Launch validation : jobs launched through the API can be checked like browser launches (see Launch validation).
  • Rate limits : only the login, logout, token refresh and single sign-on endpoints, the password change (PUT /api/v2/profile) and the API token endpoints (POST and DELETE /api/v2/profile/tokens) are limited (see Authentication). Other calls have no rate limit (the chat assistant has limits of its own), so a script should pace itself, for example when it follows a job.

In this section

Each topic has a page of its own:

Page What it covers
Authentication Log in, refresh the token, or use a long-lived token
Jobs Launch a form, follow the job, abort, relaunch or approve it
Responses and errors The shape of a response, and the status codes
Live events Hear when jobs and settings change, instead of polling