search mobile facets autocomplete spellcheck crawler rankings weights synonyms analytics engage api customize documentation install setup technology content domains user history info home business cart chart contact email activate analyticsalt analytics autocomplete cart contact content crawling custom documentation domains email engage faceted history info install mobile person querybuilder search setup spellcheck synonyms weights engage_search_term engage_related_content engage_next_results engage_personalized_results engage_recent_results success add arrow-down arrow-left arrow-right arrow-up caret-down caret-left caret-right caret-up check close content conversions-small conversions details edit grid help small-info error live magento minus move photo pin plus preview refresh search settings small-home stat subtract text trash unpin wordpress x alert case_deflection advanced-permissions keyword-detection predictive-ai sso

Credentials

The Credentials endpoint enables API based management of your various access credentials. Credentials refer to your API Keys. You can view your active API Keys, their permissions and which engines they can access. The endpoint is also used to craft and scope the following keys:

  • Private API Keys
  • Private Admin Keys
  • Public Search Keys

Your choice of Key will depend on the endpoint that you would like to access:

Key Name Key Prefix Endpoint
Public Search Key public- Search endpoint only.
Private API Key private- All endpoints except Credentials.
It is recommended that you use the Public Search Key when using the Search endpoint.
Private Admin Key admin- Credentials endpoint only.

Authentication

For authentication, the credentials endpoint requires your unique Host Identifier and a Private Admin Key. A Private Admin Key is not generated for you upon account creation, so you must create one. The key begins with admin- and is required within all of your requests.

You can generate the key by visiting the Manage Credentials view within your dashboard:

Private Admin Key - Generate your own
Generating Private Admin Key

You must generate the first key on your own. With that key, you can create other Private Admin Keys.

Request / Response Examples

Below you will find examples for the following operations:

Read API Keys

List Keys

You can query the endpoint to generate an array of all active keys. The array includes: name, key value, type and options for scope. The output supports pagination, defaulting to 25 items at a time.

GET /api/as/v1/credentials
Example - A GET request for all available keys.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
{
  "meta": {
    "page": {
      "current": 3,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    },
    {
      "name": "my-search-key",
      "key": "search-lasda0ha9gah9g8ahs9h",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    },
    {
      "name": "my-admin-key",
      "key": "admin-lasda0ha9gah9g8ahs9h",
      "type": "admin"
    }
  ]
}

Example - A GET request for all available keys.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 3,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    },
    {
      "name": "my-search-key",
      "key": "search-lasda0ha9gah9g8ahs9h",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    },
    {
      "name": "my-admin-key",
      "key": "admin-lasda0ha9gah9g8ahs9h",
      "type": "admin"
    }
  ]
}

Example - A GET request for all available keys.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 3,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    },
    {
      "name": "my-search-key",
      "key": "search-lasda0ha9gah9g8ahs9h",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    },
    {
      "name": "my-admin-key",
      "key": "admin-lasda0ha9gah9g8ahs9h",
      "type": "admin"
    }
  ]
}

Example - A GET request for all available keys.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 3,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    },
    {
      "name": "my-search-key",
      "key": "search-lasda0ha9gah9g8ahs9h",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    },
    {
      "name": "my-admin-key",
      "key": "admin-lasda0ha9gah9g8ahs9h",
      "type": "admin"
    }
  ]
}

Example - A GET request for all available keys.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 3,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    },
    {
      "name": "my-search-key",
      "key": "search-lasda0ha9gah9g8ahs9h",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    },
    {
      "name": "my-admin-key",
      "key": "admin-lasda0ha9gah9g8ahs9h",
      "type": "admin"
    }
  ]
}

Example - A GET request for all available keys.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 3,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    },
    {
      "name": "my-search-key",
      "key": "search-lasda0ha9gah9g8ahs9h",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    },
    {
      "name": "my-admin-key",
      "key": "admin-lasda0ha9gah9g8ahs9h",
      "type": "admin"
    }
  ]
}

List Key

You can specify the name of a key in order to find information about that specific key. Note that the name field is not the key itself, but the name that it has been provided.

GET /api/as/v1/credentials/[API_KEY_NAME]
Example - A GET request for information about my-private-key.
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    }
  ]
}

Example - A GET request for information about my-private-key.
No Java example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    }
  ]
}

Example - A GET request for information about my-private-key.
No Node example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    }
  ]
}

Example - A GET request for information about my-private-key.
No Ruby example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    }
  ]
}

Example - A GET request for information about my-private-key.
No Python example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    }
  ]
}

Example - A GET request for information about my-private-key.
No Javascript example available, showing cURL
curl -X GET 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-lasda0ha9gah9g8ahs9h",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": true
    }
  ]
}

Create New API Key

You can create three different types of keys:

A quick reminder... The Private API Key enables access to all API endpoints. The Public Search Key enables access only to the Search endpoint. For more information on credential types, click here.

Private API Key

POST /api/as/v1/credentials
name
required
A name for your new key. It can contain letters, numbers or dashes. Limited to 64 characters.
type
required
To generate a Private API Key, the type must be private.
read
required
Can be true or false. If true, the key can read from the engine. If false, the key can not.
write
required
Can be true or false. If true, the key can write to an engine. If false, the key can not.
access_all_engines
optional
Considers all present and future engines. Can be true or false. If true, do not include engines. If false, you must include engines.
engines
optional
If access_all_engines is set to false, provide the engines that the key is permitted to access.
Example - A POST request to create a Private API Key named reading-private-key with read only access to my-second-engine.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "reading-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": false,
  "engines": [
    "my-second-engine"
  ]
}
]'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "private-newprivatereadingkey",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Private API Key named reading-private-key with read only access to my-second-engine.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "reading-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": false,
  "engines": [
    "my-second-engine"
  ]
}
]'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "private-newprivatereadingkey",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Private API Key named reading-private-key with read only access to my-second-engine.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "reading-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": false,
  "engines": [
    "my-second-engine"
  ]
}
]'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "private-newprivatereadingkey",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Private API Key named reading-private-key with read only access to my-second-engine.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "reading-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": false,
  "engines": [
    "my-second-engine"
  ]
}
]'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "private-newprivatereadingkey",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Private API Key named reading-private-key with read only access to my-second-engine.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "reading-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": false,
  "engines": [
    "my-second-engine"
  ]
}
]'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "private-newprivatereadingkey",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Private API Key named reading-private-key with read only access to my-second-engine.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "reading-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": false,
  "engines": [
    "my-second-engine"
  ]
}
]'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "private-newprivatereadingkey",
      "type": "private",
      "read": true,
      "write": false,
      "access_all_engines": false,
      "engines": [
        "my-second-engine"
      ]
    }
  ]
}

Public Search Key

POST /api/as/v1/credentials
name
required
A name for your new key. It can contain letters, numbers or dashes. Limited to 64 characters.
type
required
To generate a Public Search Key, type must be search.
access_all_engines
optional
Considers all present and future engines. Can be true or false. If true, do not include engines. If false, you must include engines.
engines
optional
If access_all_engines is set to false, provide the engines that the key is permitted to access.
Example - A POST request to create a Public Search Key named public-searching-key with search access to my-first-engine and my-second-engine.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "public-searching-key",
  "type": "search",
  "access_all_engines": false,
  "engines": [
    "my-first-engine",
    "my-second-engine"
  ]
}
]'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "public-searching-key",
      "key": "search-newpublicsearchingkey",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-first-engine",
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Public Search Key named public-searching-key with search access to my-first-engine and my-second-engine.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "public-searching-key",
  "type": "search",
  "access_all_engines": false,
  "engines": [
    "my-first-engine",
    "my-second-engine"
  ]
}
]'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "public-searching-key",
      "key": "search-newpublicsearchingkey",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-first-engine",
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Public Search Key named public-searching-key with search access to my-first-engine and my-second-engine.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "public-searching-key",
  "type": "search",
  "access_all_engines": false,
  "engines": [
    "my-first-engine",
    "my-second-engine"
  ]
}
]'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "public-searching-key",
      "key": "search-newpublicsearchingkey",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-first-engine",
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Public Search Key named public-searching-key with search access to my-first-engine and my-second-engine.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "public-searching-key",
  "type": "search",
  "access_all_engines": false,
  "engines": [
    "my-first-engine",
    "my-second-engine"
  ]
}
]'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "public-searching-key",
      "key": "search-newpublicsearchingkey",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-first-engine",
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Public Search Key named public-searching-key with search access to my-first-engine and my-second-engine.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "public-searching-key",
  "type": "search",
  "access_all_engines": false,
  "engines": [
    "my-first-engine",
    "my-second-engine"
  ]
}
]'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "public-searching-key",
      "key": "search-newpublicsearchingkey",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-first-engine",
        "my-second-engine"
      ]
    }
  ]
}

Example - A POST request to create a Public Search Key named public-searching-key with search access to my-first-engine and my-second-engine.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "public-searching-key",
  "type": "search",
  "access_all_engines": false,
  "engines": [
    "my-first-engine",
    "my-second-engine"
  ]
}
]'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "public-searching-key",
      "key": "search-newpublicsearchingkey",
      "type": "search",
      "access_all_engines": false,
      "engines": [
        "my-first-engine",
        "my-second-engine"
      ]
    }
  ]
}

Private Admin Key

POST /api/as/v1/credentials
name
required
A name for your new key. It can contain letters, numbers or dashes. Limited to 64 characters.
type
required
To generate a Private Admin Key, type must be admin.
Example - A POST request to create a Private Admin Key named private-admin-key.
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "private-admin-key",
  "type": "admin"
}
]'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "admin-newprivateadminkey",
      "type": "admin"
    }
  ]
}

Example - A POST request to create a Private Admin Key named private-admin-key.
No Java example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "private-admin-key",
  "type": "admin"
}
]'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "admin-newprivateadminkey",
      "type": "admin"
    }
  ]
}

Example - A POST request to create a Private Admin Key named private-admin-key.
No Node example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "private-admin-key",
  "type": "admin"
}
]'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "admin-newprivateadminkey",
      "type": "admin"
    }
  ]
}

Example - A POST request to create a Private Admin Key named private-admin-key.
No Ruby example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "private-admin-key",
  "type": "admin"
}
]'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "admin-newprivateadminkey",
      "type": "admin"
    }
  ]
}

Example - A POST request to create a Private Admin Key named private-admin-key.
No Python example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "private-admin-key",
  "type": "admin"
}
]'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "admin-newprivateadminkey",
      "type": "admin"
    }
  ]
}

Example - A POST request to create a Private Admin Key named private-admin-key.
No Javascript example available, showing cURL
curl -X POST 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "private-admin-key",
  "type": "admin"
}
]'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "reading-private-key",
      "key": "admin-newprivateadminkey",
      "type": "admin"
    }
  ]
}

Update API Key

Updating an existing key follows the same pattern as creating a new key, only this time you must provide the name of your key within your API Endpoint.

You are unable to change the type of a key!
PUT /api/as/v1/credentials/[API_KEY_NAME]
name
required
You can provide a new name for your new key. It can contain letters, numbers or dashes. Limited to 64 characters.
read
required
Only accepted if the key is a Private API Key. Can be true or false. If true, the key can read from the engine. If false, the key can not.
write
required
Only accepted if the key is a Private API Key. Can be true or false. If true, the key can write to an engine. If false, the key can not.
access_all_engines
optional
Considers all present and future engines. Can be true or false. If true, do not include engines. If false, you must include engines.
engines
optional
If access_all_engines is set to false, provide the engines that the new key can access.
Example - A PUT request to update my-private-key so that it has access to all engines.
curl -X PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "my-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": true
}
]'
Example Response
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-sameoldprivatekey",
      "type": "private",
      "access_all_engines": true
    }
  ]
}

Example - A PUT request to update my-private-key so that it has access to all engines.
No Java example available, showing cURL
curl -X PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "my-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": true
}
]'
Example Response
No Java example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-sameoldprivatekey",
      "type": "private",
      "access_all_engines": true
    }
  ]
}

Example - A PUT request to update my-private-key so that it has access to all engines.
No Node example available, showing cURL
curl -X PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "my-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": true
}
]'
Example Response
No Node example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-sameoldprivatekey",
      "type": "private",
      "access_all_engines": true
    }
  ]
}

Example - A PUT request to update my-private-key so that it has access to all engines.
No Ruby example available, showing cURL
curl -X PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "my-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": true
}
]'
Example Response
No Ruby example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-sameoldprivatekey",
      "type": "private",
      "access_all_engines": true
    }
  ]
}

Example - A PUT request to update my-private-key so that it has access to all engines.
No Python example available, showing cURL
curl -X PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "my-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": true
}
]'
Example Response
No Python example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-sameoldprivatekey",
      "type": "private",
      "access_all_engines": true
    }
  ]
}

Example - A PUT request to update my-private-key so that it has access to all engines.
No Javascript example available, showing cURL
curl -X PUT 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx' \
-d '[
{
  "name": "my-private-key",
  "type": "private",
  "read": true,
  "write": false,
  "access_all_engines": true
}
]'
Example Response
No Javascript example available, showing cURL
{
  "meta": {
    "page": {
      "current": 1,
      "total_pages": 1,
      "total_results": 1,
      "size": 25
    }
  },
  "results": [
    {
      "name": "my-private-key",
      "key": "private-sameoldprivatekey",
      "type": "private",
      "access_all_engines": true
    }
  ]
}

Delete API Keys

DELETE /api/as/v1/credentials/[API_KEY_NAME]
Example - A DELETE request to destroy my-private-key.
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
{
  "deleted": true
}

Example - A DELETE request to destroy my-private-key.
No Java example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Java example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy my-private-key.
No Node example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Node example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy my-private-key.
No Ruby example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Ruby example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy my-private-key.
No Python example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Python example available, showing cURL
{
  "deleted": true
}

Example - A DELETE request to destroy my-private-key.
No Javascript example available, showing cURL
curl -X DELETE 'https://host-2376rb.api.swiftype.com/api/as/v1/credentials/my-private-key' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer admin-xxxxxxxxxxxxxxxx'
Example Response
No Javascript example available, showing cURL
{
  "deleted": true
}