v1

latestOpenAPI 3.0.3Apache 2.02026-07-133681213.9 KB
Connections

Authorize Access Token

Triggers exchanging persisted connection credentials for an access token and store it in Vault. Currently supported for connections with the client_credentials or password OAuth grant type.

Note:

  • Do not include any credentials in the request body. This operation does not persist changes, but only triggers the exchange of persisted connection credentials for an access token.
  • The access token will not be returned in the response. A 200 response code indicates the authorization was successful and that a valid access token was stored on the connection.
  • The access token will be used for subsequent API requests.
post/vault/connections/{unified_api}/{service_id}/token

Path parameters

service_idstring required

Service ID of the resource to return

unified_apistring required

Unified API

Headers

x-apideck-consumer-idstring required

ID of the consumer which you want to get or push data from

x-apideck-app-idstring required

The ID of your Unify application

Request body

object required

Response

Connection

status_codeinteger required

HTTP Response Status Code

statusstring required

HTTP Response Status

_rawRaw nullable

Raw response from the integration when raw=true query param is provided

Example response

{
  "status_code": 200,
  "status": "OK",
  "data": {
    "id": "crm+salesforce",
    "service_id": "salesforce",
    "name": "Salesforce",
    "tag_line": "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
    "unified_api": "crm",
    "state": "authorized",
    "integration_state": "configured",
    "auth_type": "oauth2",
    "oauth_grant_type": "authorization_code",
    "enabled": true,
    "website": "https://www.salesforce.com",
    "icon": "https://res.cloudinary.com/apideck/image/upload/v1529456047/catalog/salesforce/icon128x128.png",
    "logo": "https://c1.sfdcstatic.com/content/dam/web/en_us/www/images/home/logo-salesforce-m.svg",
    "authorize_url": "https://unify.apideck.com/vault/authorize/salesforce/<application-id>?state=<state>",
    "revoke_url": "https://unify.apideck.com/vault/revoke/salesforce/<application-id>?state=<state>",
    "settings": {
      "instance_url": "https://eu28.salesforce.com",
      "api_key": "12345xxxxxx"
    },
    "metadata": {
      "account": {
        "name": "My Company",
        "id": "c01458a5-7276-41ce-bc19-639906b0450a"
      },
      "plan": "enterprise"
    },
    "form_fields": [
      {
        "id": "instance_url",
        "label": "Instance url",
        "value": "https://eu28.salesforce.com",
        "placeholder": "",
        "mask": false,
        "type": "text",
        "required": true,
        "disabled": false,
        "custom_field": false,
        "sensitive": false
      },
      {
        "id": "api_key",
        "label": "API Key",
        "value": "123455677",
        "placeholder": "",
        "mask": false,
        "type": "text",
        "required": true,
        "disabled": false,
        "custom_field": false,
        "sensitive": true
      }
    ],
    "configuration": [
      {
        "resource": "leads",
        "defaults": [
          {
            "target": "custom_fields",
            "id": "ProductInterest",
            "options": [
              {
                "label": "General Channel",
                "value": "general"
              }
            ],
            "value": "GC5000 series"
          }
        ]
      }
    ],
    "configurable_resources": [
      "opportunities",
      "companies",
      "contacts",
      "leads"
    ],
    "resource_schema_support": [
      "leads"
    ],
    "resource_settings_support": [
      "leads"
    ],
    "settings_required_for_authorization": [
      "client_id",
      "client_secret"
    ],
    "subscriptions": [
      {
        "downstream_id": "5f5f5f5f5f5f5f5f5f5f5f5f",
        "unify_event_types": [
          "crm.contact.created"
        ],
        "downstream_event_types": [
          "contacts.CREATED"
        ],
        "execute_url": "https://unify.apideck.com/webhook/w/{lookupIdToken}/{serviceId}?e={downstreamEventType}",
        "created_at": "2020-10-01T12:00:00.000Z"
      }
    ],
    "has_guide": true,
    "custom_mappings": [
      {
        "id": "hris+employees+first_aid_training",
        "label": "First Aid Training",
        "description": "First Aid Training completed after 2019-01-01",
        "value": "$.root.training.first_aid",
        "key": "first_aid_training",
        "custom_field": true,
        "consumer_id": "test_user_id",
        "example": "Some value"
      }
    ],
    "consent_state": "granted",
    "consents": [
      {
        "id": "con_1234567890",
        "created_at": "2025-04-15T14:30:00Z",
        "granted": true,
        "resources": {
          "hris.employees": {
            "id": {
              "read": true,
              "write": false
            },
            "first_name": {
              "read": true,
              "write": true
            },
            "last_name": {
              "read": true,
              "write": true
            },
            "email": {
              "read": true,
              "write": true
            },
            "addresses[].street": {
              "read": true,
              "write": false
            },
            "addresses[].city": {
              "read": true,
              "write": false
            },
            "employment.job_title": {
              "read": true,
              "write": true
            },
            "custom_fields[].employee_number": {
              "read": true,
              "write": false
            }
          },
          "hris.departments": {
            "id": {
              "read": true,
              "write": false
            },
            "name": {
              "read": true,
              "write": true
            },
            "code": {
              "read": true,
              "write": false
            }
          }
        }
      }
    ],
    "latest_consent": {
      "id": "con_1234567890",
      "created_at": "2025-04-15T14:30:00Z",
      "granted": true,
      "resources": {
        "hris.employees": {
          "id": {
            "read": true,
            "write": false
          },
          "first_name": {
            "read": true,
            "write": true
          },
          "last_name": {
            "read": true,
            "write": true
          },
          "email": {
            "read": true,
            "write": true
          },
          "addresses[].street": {
            "read": true,
            "write": false
          },
          "addresses[].city": {
            "read": true,
            "write": false
          },
          "employment.job_title": {
            "read": true,
            "write": true
          },
          "custom_fields[].employee_number": {
            "read": true,
            "write": false
          }
        },
        "hris.departments": {
          "id": {
            "read": true,
            "write": false
          },
          "name": {
            "read": true,
            "write": true
          },
          "code": {
            "read": true,
            "write": false
          }
        }
      }
    },
    "application_data_scopes": {
      "enabled": true,
      "updated_at": "2025-04-15T14:30:00Z",
      "resources": {
        "hris.employees": {
          "id": {
            "read": true,
            "write": false
          },
          "first_name": {
            "read": true,
            "write": true
          },
          "last_name": {
            "read": true,
            "write": true
          },
          "email": {
            "read": true,
            "write": true
          },
          "addresses[].street": {
            "read": true,
            "write": false
          },
          "addresses[].city": {
            "read": true,
            "write": false
          },
          "employment.job_title": {
            "read": true,
            "write": true
          },
          "custom_fields[].employee_number": {
            "read": true,
            "write": false
          }
        },
        "hris.departments": {
          "id": {
            "read": true,
            "write": false
          },
          "name": {
            "read": true,
            "write": true
          },
          "code": {
            "read": true,
            "write": false
          }
        }
      }
    },
    "health": "ok",
    "credentials_expire_at": 1730172800000,
    "last_refresh_failed_at": 1730000000000,
    "last_downstream_error_at": 1730000000000,
    "created_at": 1615563533390,
    "updated_at": 1616662325753
  },
  "meta": {
    "items_on_page": 50,
    "cursors": {
      "previous": "em9oby1jcm06OnBhZ2U6OjE=",
      "current": "em9oby1jcm06OnBhZ2U6OjI=",
      "next": "em9oby1jcm06OnBhZ2U6OjM="
    },
    "total_count": 1,
    "warnings": [
      {
        "type": "downstream_request_failed",
        "status_code": 429,
        "operation": "getManager"
      }
    ]
  }
}