v1

latestOpenAPI 3.0.3Apache 2.02026-07-133681213.9 KB
Consumers

Create consumer

Create a consumer

post/vault/consumers

Headers

x-apideck-app-idstring required

The ID of your Unify application

Request body

consumer_idstring required

Unique consumer identifier. You can freely choose a consumer ID yourself. Most of the time, this is an ID of your internal data model that represents a user or account in your system (for example account:12345). If the consumer doesn't exist yet, Vault will upsert a consumer based on your ID.

Example request

{
  "consumer_id": "test_consumer_id",
  "metadata": {
    "account_name": "SpaceX",
    "user_name": "Elon Musk",
    "email": "elon@musk.com",
    "image": "https://www.spacex.com/static/images/share.jpg"
  }
}

Response

Consumer created

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": {
    "consumer_id": "test_consumer_id",
    "application_id": "dSBdXd2H6Mqwfg0atXHXYcysLJE9qyn1VwBtXHX",
    "metadata": {
      "account_name": "SpaceX",
      "user_name": "Elon Musk",
      "email": "elon@musk.com",
      "image": "https://www.spacex.com/static/images/share.jpg"
    },
    "connections": [
      {
        "id": "1111+test_user_id",
        "name": "Salesforce",
        "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",
        "website": "https://www.salesforce.com",
        "tag_line": "CRM software solutions and enterprise cloud computing from Salesforce, the leader in customer relationship management (CRM) and PaaS. Free 30 day trial.",
        "service_id": "teamleader",
        "unified_api": "crm",
        "consumer_id": "test_user_id",
        "auth_type": "oauth2",
        "enabled": true,
        "settings": {
          "instance_url": "https://eu28.salesforce.com"
        },
        "metadata": {
          "account": {
            "name": "My Company",
            "id": "c01458a5-7276-41ce-bc19-639906b0450a"
          },
          "plan": "enterprise"
        },
        "created_at": "2020-09-19T12:18:37.071Z",
        "updated_at": "2020-09-19T12:18:37.071Z",
        "state": "authorized",
        "health": "ok"
      }
    ],
    "services": [
      "salesforce",
      "stripe"
    ],
    "aggregated_request_count": 101,
    "request_counts": {
      "unify": 100,
      "proxy": 10,
      "vault": 21
    },
    "created": "2021-05-07T12:55:42.242Z",
    "modified": "2021-05-07T12:55:42.242Z",
    "request_count_updated": "2021-05-07T12:55:42.242Z"
  }
}