Skip to content
Skip to Content
DevelopersAPI referenceSpaces

Save a search as a Smart Space

POST
/v1/spaces

A user can have at most 50 spaces. query is the text of a search and can use the operators from GET /v1/search.

Authorization

bearer
headerAuthorizationBearer <token>

A personal API key (ga_…), sent as Authorization: Bearer ga_…. A key gets 403 on a resource it has no access to, and on anything that changes data without write access.

Request Body

application/json
  1. body
name*string
Lengthlength <= 80
query*string
Lengthlength <= 500
color?|

Accent color of a space. Either a palette name (red, orange, yellow, green, teal, blue, purple, pink), so each client can tune it for light and dark themes, or a custom color as lowercase #rrggbb. Uppercase and 3-digit hex are rejected, and the value is stored as sent. null means no color. Omit it on create for no color; omit it on update to leave it as is, send null to clear it. Anything else is a 422.

Match^(red|orange|yellow|green|teal|blue|purple|pink|#[0-9a-f]{6})$

Response Body

The new space

application/json
  1. response
id*string
name*string
query*string

The text of the saved search. It can use search operators.

color?|

Accent color of a space. Either a palette name (red, orange, yellow, green, teal, blue, purple, pink), so each client can tune it for light and dark themes, or a custom color as lowercase #rrggbb. Uppercase and 3-digit hex are rejected, and the value is stored as sent. null means no color. Omit it on create for no color; omit it on update to leave it as is, send null to clear it. Anything else is a 422.

Match^(red|orange|yellow|green|teal|blue|purple|pink|#[0-9a-f]{6})$
created_at*string
Formatdate-time
updated_at*string
Formatdate-time
Example Request
curl -X POST 'https://example.com/v1/spaces' \  -H 'Content-Type: application/json' \  -d '{  "name": "string",  "query": "string"}'
Example Response
{  "id": "string",  "name": "string",  "query": "string",  "color": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z"}