Ranla Cli Login API

Sign a CLI or coding agent in through the browser, with no key to copy: start a sign-in, show the person the link and code, poll until they approve, and receive a new API key for the workspace they picked.

GitHub OpenAPI

Operations 4

POST /cli/login Start a CLI sign-in #
POST /cli/login/token Poll a CLI sign-in #
GET /cli/session Who this key acts as #
DELETE /cli/session Sign the CLI out #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • 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.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/ranla-ai:ranla-ai-clilogin-api"
All apis
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.

Get an API 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 Specification

ranla-ai-clilogin-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Ranla Cli Login API
  version: 0.12.0
  description: 'Transactional email API for developers.

    Auth: `Authorization: Bearer rnl_…` or `stx_…` (or dashboard session cookie for integrations).

    Production base URL: https://api.ranla.ai'
servers:
- url: https://api.ranla.ai
  description: Production
tags:
- name: CliLogin
  description: 'Sign a CLI or coding agent in through the browser, with no key to copy:

    start a sign-in, show the person the link and code, poll until they

    approve, and receive a new API key for the workspace they picked.'
paths:
  /cli/login:
    post:
      operationId: startCliLogin
      summary: Start a CLI sign-in
      tags:
      - CliLogin
      security: []
      description: 'Starts a device sign-in for the CLI (`ranla login`). No key needed. Show

        the person `verification_url` and `user_code`; they sign up or sign in,

        check the code, pick the workspace and approve. Meanwhile poll

        `POST /cli/login/token` with `device_code` every `interval` seconds.

        Rate limited per client address.'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                workspace:
                  type: string
                  description: Workspace name or id to suggest on the approval page. The person still decides.
      responses:
        '200':
          description: Sign-in started
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CliLoginStart'
        '429':
          description: Too many sign-ins started from this address
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleErrorResponse'
  /cli/login/token:
    post:
      operationId: pollCliLogin
      summary: Poll a CLI sign-in
      tags:
      - CliLogin
      security: []
      description: 'The CLI''s poll. `pending` until the person decides; `denied` if they

        canceled; `expired` after ten minutes or once the key was handed out.

        `approved` returns a new API key for the workspace they picked, once.'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - device_code
              properties:
                device_code:
                  type: string
      responses:
        '200':
          description: Current status, with the key when approved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CliLoginPoll'
        '400':
          description: Missing or malformed device code
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Polling too fast
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SimpleErrorResponse'
  /cli/session:
    get:
      operationId: getCliSession
      summary: Who this key acts as
      tags:
      - CliLogin
      security:
      - bearerAuth: []
      description: 'The workspace the key belongs to, the key itself, and — for a key made

        by a CLI sign-in — the person who approved it. Needs a full-scope key.'
      responses:
        '200':
          description: The key's workspace and person
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CliSession'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      operationId: deleteCliSession
      summary: Sign the CLI out
      tags:
      - CliLogin
      security:
      - bearerAuth: []
      description: 'Revokes the key making the request when a CLI sign-in made it. A key

        created in Settings → API keys is left alone (`revoked: false`).'
      responses:
        '200':
          description: Whether the key was revoked
          content:
            application/json:
              schema:
                type: object
                required:
                - revoked
                properties:
                  revoked:
                    type: boolean
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    ErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: object
          required:
          - message
          properties:
            message:
              type: string
            code:
              $ref: '#/components/schemas/ErrorCode'
            upgrade_url:
              type: string
              description: Dashboard path to upgrade when code is plan_limit or domain_limit
            details:
              description: 'Optional structured details. For send blocks this may include `suppressed` (global suppression list) or `category_unsubscribed` plus `category` and `email_id` (category opt-out).

                '
    SimpleErrorResponse:
      type: object
      required:
      - error
      properties:
        error:
          type: string
    CliLoginStart:
      type: object
      required:
      - device_code
      - user_code
      - verification_url
      - expires_in
      - interval
      properties:
        device_code:
          type: string
          description: Secret. Poll with it; never show it.
        user_code:
          type: string
          example: BCDF-GHJK
          description: What the person checks on the approval page.
        verification_url:
          type: string
          format: uri
          description: The approval page, with the code filled in.
        expires_in:
          type: integer
          description: Seconds until the sign-in expires.
        interval:
          type: integer
          description: Seconds to wait between polls.
    CliSession:
      type: object
      required:
      - workspace
      - user
      - key
      properties:
        workspace:
          type: object
          required:
          - id
          - name
          properties:
            id:
              type: string
            name:
              type: string
        user:
          type:
          - object
          - 'null'
          description: The person who approved the CLI sign-in. Null for a key made in Settings.
          properties:
            id:
              type: string
            email:
              type: string
        key:
          type:
          - object
          - 'null'
          properties:
            id:
              type: string
            name:
              type: string
            prefix:
              type: string
            scope:
              type: string
              enum:
              - full
              - sending
            fromLogin:
              type: boolean
              description: Made by a CLI sign-in (so `DELETE /cli/session` revokes it).
    CliLoginPoll:
      type: object
      required:
      - status
      properties:
        status:
          type: string
          enum:
          - pending
          - approved
          - denied
          - expired
        api_key:
          type: string
          description: Only when `approved`, and only once. A full-scope key for the workspace the person picked.
        key:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
            prefix:
              type: string
        user:
          type: object
          properties:
            id:
              type: string
            email:
              type: string
        workspace:
          type: object
          properties:
            id:
              type: string
            name:
              type: string
    ErrorCode:
      type: string
      description: Machine-readable error code
      enum:
      - validation_error
      - unauthorized
      - forbidden
      - not_found
      - conflict
      - plan_limit
      - domain_limit
      - idempotency_conflict
      - rate_limited
      - upstream_error
      - not_configured
      - internal_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Ranla API key prefixed with `rnl_` or `stx_`