Admin API
The Admin API is a tool that enables you to directly manage your api.video projects and API keys through a secure API. This is a robust solution with a simple goal: to make it easy for you to manage your projects and thus your users, and their access to your platform on a programmatic level.
Some examples where the Admin API can be especially useful:
- when you want to segment your user base and measure usage more granularly
- when you work with multiple clients and want to enable them separate access to different projects
- when you have users needing different folders/projects
Server URL
You should direct each HTTP call to the Admin API through this server URL:
https://admin.api.video
Endpoints
The Admin API offers 2 sets of endpoints: /projects
and /api-keys
. In general, the Projects endpoints enable you to programmatically list all your projects, get a specific project, and to create or update a project, while the API keys endpoints enable you to programmatically list all your API keys, get a specific API key, and to create, update, or delete an API key.
Authentication
This API uses Basic HTTP authentication scheme, which requires an admin API key to interact with the Admin API. This API key is different from your individual projects’ API keys as it’s one level above them.
Contact the Customer support team to request your admin API key.
The basic authentication requires adding an HTTP header in your request:
Authorization: Basic $base64Credentials
Where $base64Credentials
is the concatenation of your API key and :
, then base 64 encoded.
The credentials for the Admin API are in the form username:password
, where the API key acts as the username
and password
is left empty.
Example authentication
curl -u "$adminApiKey:" https://admin.api.video/projects/count
Interacting with the Admin API
- The API uses the REST approach: JSON requests and responses over HTTP.
- Every property you define in your requests should be in
snake_case
.
Your calls to the Admin API are rate limited at 10 requests / second.
/count
Example request for GET https://admin.api.video/projects/count
Authorization: Basic $base64Credentials
200 OK
{
"count": 142305
}
Where $base64Credentials
is the concatenation of your API key and :
, then base 64 encoded.
Pagination
All lists in the API’s responses are paginated. The default page size is 20 records, and the maximum page size is 100 records. You can define page size in your requests.
Paged responses include links under the links
object. These links help you navigate the paginated list of results:
"rel": "previous"
links to the previous page, when the current page is more than 1"rel": "self”
links to the current page"rel": "next"
links to the next page when the list has more items. This is useful for building infinite scroll.
For example, if you want to retrieve the next page of results, you can make another request with the page number, which you can pull from the links
object with the value of rel: "next"
value.
A call to GET https://ws.api.video/videos?currentPage=2&pageSize=20
will give you the next 20 videos.
- Default page size: 20 records
- Max page size: 100 records
Paged responses do not include the total number of items. To get the count for total number of items, make a separate API call to the /count
operation. This enables the Admin API to have better responsiveness when listing large amounts of data.
Pagination example
{
"items": [...],
"pagination": {...},
"links": [
{
"rel": "self",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=1"
},
{
"rel": "next",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=2"
}
]
}
{
"items": [...],
"pagination": {...},
"links": [
{
"rel": "previous",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=1"
},
{
"rel": "self",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=2"
},
{
"rel": "next",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=3"
}
]
}
{
"items": [...],
"pagination": {...},
"links": [
{
"rel": "previous",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=2"
},
{
"rel": "self",
"href": "/projects?page_size=20&name=aaa&sort_by=name&sort_order=desc&page=3"
},
]
}