Skip to main content

REST API

Within the exception of encapsulation, all the functionality of Antimatter is exposed via a REST API. You can download the OpenAPI spec here or use the interactive Swagger UI.

Authentication

All domain operations in the API require a domain identity token to be included as a bearer token. This can be obtained from the /authenticate endpoint in a domain as shown in the example below:

#!/bin/bash

# A simple script to list the capsules in a domain
id="dm-dZdLzWR9G21"
apiKey="YXBpa2V5Omd2anh2ZoZ4WGlDOVgzdVkyR1Q4Nm12QWVDcTNTSGhR"
api="https://api.antimatter.io/v1"

# Create an auth token
token=$(
curl -sS -X 'POST' \
"${api}/domains/${id}/authenticate" \
-H 'Content-Type: application/json' \
-d '{"token": "'$apiKey'"}' \
| jq -r .token)

# Now you can interact with the domain using the domain identity bearer token
# For example, to list the capsules in a domain:
curl -sS -H "Authorization: Bearer $token" -X 'GET' \
"${api}/domains/${id}/capsules"