Description

Use a HTTP POST request to create a OAuth2.0 user credential.

Request

HTTP Method: POST

Parameter Description
name Name of the user credential.
mode Describes the type of credential (OAUTH)
oauth_url Your app oauth url
oauth_token_url Your app oauth token url
oauth_client_id The client ID for your app
oauth_client_secret The client secret for your app
oauth_scope Enter one or more scope values indicating which parts of the user’s account you wish to access
oauth_grant_type Tines supports client_credentials and authorization_code grants.
team_id ID of Tines Team where the user credential will be located.
folder_id Optional ID of folder to which the user credential will be located
read_access Optional Control where this credential can be used (TEAM, GLOBAL). default: TEAM

Sample request

curl -X POST \
  https://<tenant-domain>/api/v1/user_credentials \
  -H 'content-type: application/json' \
  -H 'x-user-email: <email-address>' \
  -H 'x-user-token: <api-token>' \
  -d '{
        "name": "foo",
        "value": "bar",
        "mode": "OAUTH",
        "team_id": 2,
        "oauth_url": "https://example.com/auth",
        "oauth_token_url": "https://example.com/token",
        "oauth_client_id": "foo",
        "oauth_client_secret": "bar",
        "oauth_scope": "sync",
        "oauth_grant_type": "authorization_code",
    }'

Response

A successful request will return a JSON object containing a redirect_url to complete the registration process and a description of the created credential.

Field description

Parameter Description
id User credential ID.
name Name of the user credential.
mode Describes the type of credential (TEXT, JWT, OAUTH, AWS, MTLS, HTTP_REQUEST_AGENT)
team_id ID of team to which the user credential belongs.
folder_id ID of folder to which the user credential belongs.
read_access Control where this credential can be used.
slug An underscored representation of the credential name
created_at ISO 8601 Timestamp representing date and time the credential was created.
updated_at ISO 8601 Timestamp representing date and time the credential was last updated.

Sample response

{
  "redirect_url": "",
  "user_credential": {
    "id": 1,
    "name": "tines_api_credential",
    "mode": "OAUTH",
    "team_id": 2,
    "folder_id": 1,
    "created_at": "2021-03-26T12:34:16.540Z",
    "updated_at": "2021-03-26T12:34:16.540Z"
  }
}