curl --request POST \
--url https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Service account for ingestion pipeline",
"name": "backend-service",
"permissions": [
"read",
"write"
],
"rate_limit_override": 120
}
'import requests
url = "https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys"
payload = {
"description": "Service account for ingestion pipeline",
"name": "backend-service",
"permissions": ["read", "write"],
"rate_limit_override": 120
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Service account for ingestion pipeline',
name: 'backend-service',
permissions: ['read', 'write'],
rate_limit_override: 120
})
};
fetch('https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Service account for ingestion pipeline',
'name' => 'backend-service',
'permissions' => [
'read',
'write'
],
'rate_limit_override' => 120
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys"
payload := strings.NewReader("{\n \"description\": \"Service account for ingestion pipeline\",\n \"name\": \"backend-service\",\n \"permissions\": [\n \"read\",\n \"write\"\n ],\n \"rate_limit_override\": 120\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Service account for ingestion pipeline\",\n \"name\": \"backend-service\",\n \"permissions\": [\n \"read\",\n \"write\"\n ],\n \"rate_limit_override\": 120\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Service account for ingestion pipeline\",\n \"name\": \"backend-service\",\n \"permissions\": [\n \"read\",\n \"write\"\n ],\n \"rate_limit_override\": 120\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2025-01-01T00:00:00Z",
"created_by": "usr_admin",
"description": "Service account for ingestion",
"internal_id": "int_x1y2z3",
"key_hash": "2c26b46b68ffc68ff99b453c1d304134",
"key_id": "key_a1b2c3d4e5f6g7h",
"key_prefix": "sk_abc123...",
"name": "backend-service",
"organization_id": "org_demo123",
"permissions": [
"read",
"write"
],
"scopes": [],
"status": "active",
"user_id": "usr_a1b2c3d4e5f6g7h"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Create Api Key
Create a new API key for a user.
curl --request POST \
--url https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Service account for ingestion pipeline",
"name": "backend-service",
"permissions": [
"read",
"write"
],
"rate_limit_override": 120
}
'import requests
url = "https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys"
payload = {
"description": "Service account for ingestion pipeline",
"name": "backend-service",
"permissions": ["read", "write"],
"rate_limit_override": 120
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Service account for ingestion pipeline',
name: 'backend-service',
permissions: ['read', 'write'],
rate_limit_override: 120
})
};
fetch('https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Service account for ingestion pipeline',
'name' => 'backend-service',
'permissions' => [
'read',
'write'
],
'rate_limit_override' => 120
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys"
payload := strings.NewReader("{\n \"description\": \"Service account for ingestion pipeline\",\n \"name\": \"backend-service\",\n \"permissions\": [\n \"read\",\n \"write\"\n ],\n \"rate_limit_override\": 120\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Service account for ingestion pipeline\",\n \"name\": \"backend-service\",\n \"permissions\": [\n \"read\",\n \"write\"\n ],\n \"rate_limit_override\": 120\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mixpeek.com/v1/organizations/users/{user_email}/api-keys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Service account for ingestion pipeline\",\n \"name\": \"backend-service\",\n \"permissions\": [\n \"read\",\n \"write\"\n ],\n \"rate_limit_override\": 120\n}"
response = http.request(request)
puts response.read_body{
"created_at": "2025-01-01T00:00:00Z",
"created_by": "usr_admin",
"description": "Service account for ingestion",
"internal_id": "int_x1y2z3",
"key_hash": "2c26b46b68ffc68ff99b453c1d304134",
"key_id": "key_a1b2c3d4e5f6g7h",
"key_prefix": "sk_abc123...",
"name": "backend-service",
"organization_id": "org_demo123",
"permissions": [
"read",
"write"
],
"scopes": [],
"status": "active",
"user_id": "usr_a1b2c3d4e5f6g7h"
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}{
"error": {
"details": {
"id": "ns_123",
"resource": "namespace"
},
"message": "Namespace not found",
"type": "NotFoundError"
},
"status": 404,
"success": false
}Authorizations
Mixpeek API key, sent as Authorization: Bearer mxp_sk_.... Create one in Studio under Settings ā API Keys, or with an admin key via POST /v1/organizations/users/{user_email}/api-keys. A missing, malformed, unknown, revoked, inactive or expired key returns 401; a key without the permission, scope or plan an operation needs returns 403.
Body
Keys this body does not declare are refused with 422 extra_forbidden naming the accepted keys (since 2026-11-02).
Payload for creating a new API key.
Set of permissions granted to the API key. Defaults to full read/write/delete access. Restrict explicitly when creating scoped keys.
Simplified API key permissions.
This four-value enum replaces the legacy 16-permission model. Keep usage simple: prefer the least privileged option that satisfies the workflow.
Hierarchy (strongest -> weakest): ADMIN > DELETE > WRITE > READ.
read, write, delete, admin Optional list of allowed HTTP origins for this API key. When set, browser requests must include a matching Origin header. Supports exact matches and wildcard subdomains (e.g., 'https://*.example.com'). Defense-in-depth: Origin headers can be spoofed from non-browser contexts. Null means no origin restriction.
[
"https://docs.example.com",
"https://*.example.com"
]
Response
Successful Response
API key response including the plaintext secret.
Visible prefix of the API key for user identification (e.g., 'sk_abc123...'). Shows the first 10 characters of the plaintext key to help users identify which key is which in lists, without exposing the full secret. This follows industry best practices from GitHub, Stripe, and AWS. Generated automatically for new keys. Older keys may not have this field.
64"sk_abc123..."
SERVER-VERIFIED internal-actor marker. When True, this key belongs to Mixpeek's own operations (e.g. the in-org ops/health probe that must authenticate under a dedicated tenant's internal_id because the single-tenant pod gate fail-closes cross-org auth) and its usage is NOT billed to the org: accrue_mvs_usage skips the accrual and consume_credits skips the direct charge. FAIL CLOSED ā absent/False means BILL. This is the ONLY server-side source a billing skip may key on; never the client-influenced X-Mixpeek-Traffic header or mixpeek-loop-* User-Agent. Set only by an admin provisioning an internal key, never from a create request.
Permissions granted to the key.
Simplified API key permissions.
This four-value enum replaces the legacy 16-permission model. Keep usage simple: prefer the least privileged option that satisfies the workflow.
Hierarchy (strongest -> weakest): ADMIN > DELETE > WRITE > READ.
read, write, delete, admin Optional list of allowed HTTP origins for this API key. When set, requests must include an Origin header matching one of these values. Supports exact matches (e.g., 'https://docs.example.com') and wildcard subdomains (e.g., 'https://*.example.com'). Only enforced for browser requests (defense-in-depth, not a security boundary). Null means no origin restriction.
[
"https://docs.example.com",
"https://*.example.com"
]
Was this page helpful?

