Skip to Content
APIsAuthenticate to Grepr APIs

Authenticate to Grepr REST APIs

By default, most endpoints in the Grepr REST APIs are restricted and cannot be accessed until enabled. To enable access, you must have credentials provided by the Grepr support team. You then use these credentials to obtain an access token for API authentication.

To obtain the required credentials, contact Grepr support. The support team will send the following credentials:

  • client ID: A unique identifier for your organization.
  • client secret: A secret key to authenticate your organization.

The exception to the access restrictions for the Grepr APIs is the POST /v1/triggers endpoint to create external triggers.

Obtain an access token for Grepr REST APIs

Grepr uses Auth0  as the identity provider for authentication. To obtain an access token to use with Grepr APIs, you send a request to the token endpoint:

POST https://grepr-prod.us.auth0.com/oauth/token endpoint.

The following example submits a token request using the curl command. client_id and client_secret are the credential values provided by Grepr support:

curl --url https://grepr-prod.us.auth0.com/oauth/token \ --header 'content-type: application/json' \ --data '{ "client_id": "<client_id>", "client_secret": "<client_secret>", "audience": "service", "grant_type": "client_credentials" }'

Example response:

{ "access_token": "<access_token>", "token_type": "Bearer", "expires_in": "86400", "scope": "service" }
  • The access token has access to all APIs that Grepr provides to its customers. If you need to reduce the access scope of a token to restrict access to specific APIs, contact Grepr support.
  • The access token has a limited lifetime of 86400 seconds, which is equivalent to 24 hours. You must obtain a new token when it expires.
  • Keep the credentials you receive and the auth token secure. To prevent unauthorized access, do not expose these values in your client-side code or commit them to a version control repository.

Use the access token with the Grepr API

To authenticate against the Grepr APIs, include the access token as a Bearer token in the Authorization header of all API requests. If you submit a request using an expired token, a 401 Unauthorized response is returned, and you must obtain a new access token.

The following example uses the curl command to get all Asynchronous Streaming jobs from the jobs endpoint.

curl -XGET "https://<your_org_id>.app.grepr.ai/api/v1/jobs?processing=STREAMING&execution=ASYNCHRONOUS" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer <your_access_token>"

Example response:

{ "items": [ { "id": "0ABC123DEF456", "name": "Demo Job", "version": 0, "organizationId": "grepr", "execution": "ASYNCHRONOUS", "processing": "STREAMING", "state": "RUNNING", "desiredState": "RUNNING", "jobGraph": { "vertices": [], "edges": [] }, "createdAt": "2021-09-01T00:00:00Z", "updatedAt": "2021-09-01T00:00:00Z", "tags": { "createdUsing": "API", "createdByUser": "Hardworking Beaver" } } ] }
Last updated on