Stytch Project API

The Project API from Stytch — 1 operation(s) for project.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 1

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /v1/projects/metrics Get project authentication metrics · Metrics #
Ask an LLM
“How many magic links and OTPs has my project sent?”
“What does my project's authentication usage look like overall?”
Tell an agent
Show my project's authentication metrics.
Get the usage metrics for this project.

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/stytch:stytch-project-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

stytch-project-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Stytch Consumer Authentication Project API
  version: 2.0.0
  description: Stytch's Consumer API for passwordless and password-based authentication. Supports Magic Links, SMS/email/WhatsApp OTP, OAuth social login, TOTP, WebAuthn/Passkeys, Crypto Wallets, Sessions, Users, M2M tokens, Fraud / Device Fingerprinting, Connected Apps (OAuth provider / MCP), Impersonation, IDP, and Consumer RBAC.
  contact:
    name: Stytch
    url: https://stytch.com/docs
  license:
    name: Proprietary
servers:
- url: https://api.stytch.com
  description: Production
- url: https://test.stytch.com
  description: Test
tags:
- name: Project
paths:
  /v1/projects/metrics:
    get:
      summary: Metrics
      operationId: api_project_v1_Metrics
      tags:
      - Project
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/api_project_v1_MetricsResponse'
        '400':
          description: Bad request
        '401':
          description: Unauthorized
          content:
            application/json:
              example:
                status_code: 401
                request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
                error_type: unauthorized_credentials
                error_message: Unauthorized credentials.
                error_url: https://stytch.com/docs/api/errors/401
        '429':
          description: Too Many Requests
          content:
            application/json:
              example:
                status_code: 429
                request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
                error_type: too_many_requests
                error_message: Too many requests have been made.
                error_url: https://stytch.com/docs/api/errors/429
        '500':
          description: Internal server error
          content:
            application/json:
              example:
                status_code: 500
                request_id: request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141
                error_type: internal_server_error
                error_message: Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.
                error_url: https://stytch.com/docs/api/errors/500
      x-code-samples:
      - lang: csharp
        label: C#
        source: "// GET /v1/projects/metrics\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n  project_id: '${projectId}',\n  secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.Project.Metrics(params)\n  .then(resp => { console.log(resp) })\n  .catch(err => { console.log(err) });"
      - lang: go
        label: Go
        source: "// GET /v1/projects/metrics\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\t\"github.com/stytchauth/stytch-go/v17/stytch/b2b/b2bstytchapi\"\n\t\"github.com/stytchauth/stytch-go/v17/stytch/consumer/project\"\n)\n\nfunc main() {\n\tclient, err := b2bstytchapi.NewClient(\n\t\t\"${projectId}\",\n\t\t\"${secret}\",\n\t)\n\tif err != nil {\n\t\tlog.Fatalf(\"error instantiating client: %v\", err)\n\t}\n\n\tparams := &project.MetricsParams{}\n\n\tresp, err := client.Project.Metrics(context.Background(), params)\n\tif err != nil {\n\t\tlog.Fatalf(\"error in method call: %v\", err)\n\t}\n\n\tlog.Println(resp)\n}\n"
      - lang: java
        label: Java
        source: "// GET /v1/projects/metrics\npackage com.example;\n\nimport com.stytch.java.b2b.StytchB2BClient;\nimport com.stytch.java.common.StytchResult;\nimport com.stytch.java.consumer.models.project.MetricsRequest;\n\npublic class Main {\n    public static void main(String[] args) {\n        StytchB2BClient.configure(\"${projectId}\", \"${secret}\");\n\n        MetricsRequest params = new MetricsRequest();\n\n        Object result = StytchB2BClient.getProject().metrics(params);\n        if (result instanceof StytchResult.Success) {\n          System.out.println(((StytchResult.Success) result).getValue());\n        } else {\n          System.out.println(((StytchResult.Error) result).getException());\n        }\n    }\n}"
      - lang: kotlin
        label: Kotlin
        source: "// GET /v1/projects/metrics\npackage com.example\n\nimport com.stytch.java.b2b.StytchB2BClient\nimport com.stytch.java.consumer.models.project.MetricsRequest\n\nfun main() {\n    StytchB2BClient.configure(\n        projectId = \"${projectId}\",\n        secret = \"${secret}\",\n    )\n\n    when (\n        val result =\n            StytchB2BClient.project.metrics(\n                MetricsRequest(),\n            )\n    ) {\n        is StytchResult.Success -> println(result.value)\n        is StytchResult.Error -> println(result.exception)\n    }\n}\n"
      - lang: javascript
        label: Node.js
        source: "// GET /v1/projects/metrics\nconst stytch = require('stytch');\n\nconst client = new stytch.B2BClient({\n  project_id: '${projectId}',\n  secret: '${secret}',\n});\n\nconst params = {\n};\n\nclient.project.metrics(params)\n  .then(resp => { console.log(resp) })\n  .catch(err => { console.log(err) });"
      - lang: php
        label: PHP
        source: '$response = $client->project->metrics([

          ]);'
      - lang: python
        label: Python
        source: "# GET /v1/projects/metrics\nfrom stytch import B2BClient\n\nclient = B2BClient(\n    project_id=\"${projectId}\",\n    secret=\"${secret}\",\n)\n\nresp = client.project.metrics()\n\nprint(resp)\n"
      - lang: ruby
        label: Ruby
        source: "# GET /v1/projects/metrics\nrequire 'stytch'\n\nclient = StytchB2B::Client.new(\n  project_id: \"${projectId}\",\n  secret: \"${secret}\"\n)\n\nresp = client.project.metrics(\n  \n)\n\nputs resp"
      - lang: rust
        label: Rust
        source: "// GET /v1/projects/metrics\nuse stytch::b2b::client::Client;\nuse stytch::consumer::project::MetricsRequest;\n\nfn main() {\n    let client = Client::new(\"${projectId}\", \"${secret}\").unwrap();\n    let resp = client.project.metrics(\n        MetricsRequest{\n            ..Default::default()\n        }\n    ).await;\n    println!(\"The response is {:?}\", resp);\n}"
      - lang: bash
        label: cURL
        source: "# GET /v1/projects/metrics\ncurl --request GET \\\n  --url https://test.stytch.com/v1/projects/metrics \\\n  -u '${projectId}:${secret}' \\\n  -H 'Content-Type: application/json'"
components:
  schemas:
    api_project_v1_ProjectMetricMetricType:
      type: string
      enum:
      - UNKNOWN
      - USER_COUNT
      - ORGANIZATION_COUNT
      - MEMBER_COUNT
      - M2M_CLIENT_COUNT
    api_project_v1_ProjectMetric:
      type: object
      properties:
        metric_type:
          $ref: '#/components/schemas/api_project_v1_ProjectMetricMetricType'
        count:
          type: integer
          format: int32
          minimum: 0
      required:
      - metric_type
      - count
    api_project_v1_MetricsResponse:
      type: object
      properties:
        request_id:
          type: string
        project_id:
          type: string
        metrics:
          type: array
          items:
            $ref: '#/components/schemas/api_project_v1_ProjectMetric'
        status_code:
          type: integer
          format: int32
      required:
      - request_id
      - project_id
      - metrics
      - status_code
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic