Superflag Cli Token API
The Cli Token API from Superflag — 1 operation(s) for cli token.
The Cli Token API from Superflag — 1 operation(s) for cli token.
Every API here is available over the APIs.io API and to AI agents over MCP.
One button, every client — Claude, Cursor, VS Code and the rest.
https://apis.io/mcp
find_apisBrowse and filter every API in the catalog.get_api_artifactsOne API's artifacts, grouped by type.get_openapiThe primary OpenAPI for this API.find_similar_apisAPIs that look like this one.apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.resolveTurn a domain, URL or GitHub org into the provider it belongs to.find_cohortsEvery scored population of providers in the catalog.curl "https://apis.io/api/v1/apis/superflag-sh:superflag-sh-cli-token-api"
curl "https://apis.io/api/v1/apis?limit=25"
Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.
A second provider on the same verified email joins the account you already have.
openapi: 3.2.0
info:
title: Superflag control-plane evaluation and advanced…
version: 1.0.0
description: 'Public Superflag HTTP API. Discovery documents at /openapi.json and /api/v1/contract do not require auth. Delivery and management routes require Authorization: Bearer with a cli_, admin_, sdk_, or pub_ credential. See https://superflag.sh/docs/api-reference/overview.'
servers:
- url: https://superflag.sh
description: Production
tags:
- name: Cli Token
paths:
/api/v1/cli-token:
post:
operationId: authenticateCliPassword
security: []
description: Headless signup or login using the existing password provider. Returns a one-time revocable user-scoped cli_ token. Never log the body or response; save the token privately. No cookies or browser callback required.
requestBody:
required: true
content:
application/json:
schema:
type: object
additionalProperties: false
required:
- flow
- email
- password
properties:
flow:
type: string
enum:
- signUp
- signIn
email:
type: string
format: email
maxLength: 254
password:
type: string
minLength: 8
maxLength: 256
writeOnly: true
responses:
'200':
description: 'One-time CLI credential; Cache-Control: no-store'
content:
application/json:
schema:
type: object
required:
- apiVersion
- token
properties:
apiVersion:
const: 1
token:
type: string
pattern: ^cli_
'400':
description: Invalid authentication request
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'401':
description: Authentication failed
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'403':
description: Cross-origin request rejected
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'408':
description: Authentication timed out; try login after interrupted signup
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'413':
description: Body exceeds 4 KiB
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'429':
description: Authentication rate limited
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
'503':
description: Authentication unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/ApiError'
tags:
- Cli Token
summary: Authenticate cli password
x-summary-source: derived
get:
operationId: getCliUser
description: CLI identity readback with current token scope and permission. Requires a cli_ token. Errors use a string `error` field, not the management envelope.
security:
- BearerAuth: []
responses:
'200':
description: Authenticated user id and email
content:
application/json:
schema:
$ref: '#/components/schemas/CliUserResponse'
'401':
description: Missing or invalid cli_ token
content:
application/json:
schema:
$ref: '#/components/schemas/CliTokenError'
'403':
description: Wrong token type
content:
application/json:
schema:
$ref: '#/components/schemas/CliTokenError'
'404':
description: User not found
content:
application/json:
schema:
$ref: '#/components/schemas/CliTokenError'
tags:
- Cli Token
summary: Get cli user
x-summary-source: derived
components:
schemas:
CliUserResponse:
type: object
additionalProperties: false
required:
- user
- token
properties:
user:
type: object
additionalProperties: false
required:
- id
- email
properties:
id:
type: string
minLength: 1
email:
type: string
minLength: 1
token:
type: object
additionalProperties: false
required:
- id
- name
properties:
id:
type: string
minLength: 1
name:
type: string
minLength: 1
access:
type: object
required:
- scope
- permission
properties:
scope:
type: object
required:
- kind
properties:
kind:
enum:
- account
- app
- environment
appId:
type: string
envId:
type: string
permission:
enum:
- read
- write
- read-write
- manage
- admin
description: write and read-write require app or environment scope
expiresAt:
type: integer
ApiError:
type: object
additionalProperties: false
required:
- error
properties:
apiVersion:
type: integer
const: 1
code:
type: string
message:
type: string
resolution:
type: string
error:
oneOf:
- type: string
- type: object
required:
- code
- message
properties:
code:
type: string
message:
type: string
resolution:
type: string
retryable:
type: boolean
metadata:
type: object
CliTokenError:
type: object
additionalProperties: false
required:
- error
properties:
error:
type: string
securitySchemes:
BearerAuth:
type: http
scheme: bearer
ApiKeyAuth:
type: apiKey
in: header
name: X-API-Key