Skip to main content

Authentication

An unauthenticated user can use only a handful of public mutations and queries. To gain more access, session token needs to be created and used.

Creating API user key‚Äč

To generate API user key you can do that at Analytics Hub or after loging into API you can use GraphQL API.

How to generate API user key token and secret
mutation GenerateUserKey {
createUserKey {
id
secret
}
}
Show example response Show cURL example Try in explorer

Obtain session token using API user key and secret token‚Äč

How to login using API user key and secret token
mutation LoginWithUserKey($secret: String!, $userKeyId: ObjectID!) {
createSessionUsingUserKey(input: { userKeyId: $userKeyId, secret: $secret }) {
token
}
}
Show example variables Show example response Show cURL example Try in explorer

Using session token‚Äč

After signing in you will receive session token that will be valid for 30 days. To authenticate requests to the API send session token in HTTP header x-auth-token value.

curl -H "x-auth-token: <session token>" -XPOST https://graph.deepcrawl.com/ -H "Content-Type: application/json" --data-raw '{"query": "{version}"}'

Passing invalid session token will result in 401 error.