Authentication

Most endpoints require authentication, although some services support IP-based authentication for limited access. Workspaces with a paid subscription are able to create and use Access Tokens for machine use.

Access Token

An access token be used to authenticate on behalf of your workspace without the need for an interactive or human login. These tokens must be kept secure since they grant access to any resources and services of the workspace. To create a new access token, visit the Access Tokens section from your Workspace Settings page.

When authenticating an HTTP request with an access token, include an Authorization header using the Bearer scheme. For example, a request should look similar to:

GET /client/profile HTTP/1.1
Host: api.namedgraph.com
User-Agent: Example/0.1
Authorization: Bearer ngw_KxP**************************************************************1Zx

Test Request

You can verify authentication by calling the /client/profile endpoint. A successfully authenticated request will include the token's owner type and additional metadata in the .data.principal field.

$ curl https://api.namedgraph.com/client/profile \
  --header @namedgraph-auth-headers.txt \
  | jq .data.principal
{
  "workspace": {
    "resourceKeys": {
      "workspace": "01990351-4e83-70b3-9c4f-0c07a7e86527"
    }
  }
}