Skip to main content

Authentication

You will probably want to query the Prismatic API with tools outside of the GraphiQL explorer. To do that, you'll need an API token. When you authenticate against Prismatic through the web app or Prismatic CLI tool, your web browser or CLI tool receives a JWT that can be used to query the API.

To view a short-lived token in the web browser, visit https://app.prismatic.io/get_auth_token/ while logged in.

If you are using the Prismatic CLI tool, you can use the subcommand me:token.

prism me:token
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.Example

Use that token as part of your HTTP authorization header bearer token to authenticate your queries against the API. For example,

export PRISMATIC_API_TOKEN=$(prism me:token)

curl https://app.prismatic.io/api \
--request POST \
--header "Authorization: Bearer ${PRISMATIC_API_TOKEN}" \
--header "Content-Type: application/json" \
--data '{"query": "query { integrations { nodes { id name }}}"}'
longer-lived tokens

API access tokens are valid for 7 days. If you are building a script that will run within your app, or from a CI/CD pipeline, you should fetch a refresh token, which has a longer life and can be used to fetch an access token at any time. See Querying Prismatic's API From a CI/CD System