---
title: "Test OAuth2 connection"
method: POST
path: "/v1/projects/{projectID}/endpoints/oauth2/test"
tags: ["Endpoints"]
---

# Test OAuth2 connection

`POST /v1/projects/{projectID}/endpoints/oauth2/test`

This endpoint tests the OAuth2 connection by attempting to exchange a token

## Path parameters

- `projectID` string, required

## Request body

- ModelsTestOAuth2Request
  - `oauth2` ModelsOAuth2
    - `audience` string
    - `authentication_type` string
    - `client_id` string
    - `client_secret` string
    - `expiry_time_unit` string — Expiry time unit (seconds, milliseconds, minutes, hours)
    - `field_mapping` ModelsOAuth2FieldMapping
      - `access_token` string — Field name for access token (e.g., "accessToken", "access_token", "token")
      - `expires_in` string — Field name for expiry time (e.g., "expiresIn", "expires_in", "expiresAt")
      - `token_type` string — Field name for token type (e.g., "tokenType", "token_type")
    - `grant_type` string
    - `issuer` string
    - `scope` string
    - `signing_algorithm` string
    - `signing_key` ModelsOAuth2SigningKey
      - `crv` string — EC (Elliptic Curve) key fields
      - `d` string — Private key (EC) or private exponent (RSA)
      - `dp` string — RSA first factor CRT exponent (RSA private key only)
      - `dq` string — RSA second factor CRT exponent (RSA private key only)
      - `e` string — RSA public exponent (RSA only)
      - `kid` string — Key ID
      - `kty` string — Key type: "EC" or "RSA"
      - `n` string — RSA key fields
      - `p` string — RSA first prime factor (RSA private key only)
      - `q` string — RSA second prime factor (RSA private key only)
      - `qi` string — RSA first CRT coefficient (RSA private key only)
      - `x` string — X coordinate (EC only)
      - `y` string — Y coordinate (EC only)
    - `subject` string
    - `url` string

## Response `200`

OK

- object
  - `message` string
  - `status` boolean
  - `data` ModelsTestOAuth2Response
    - `access_token` string
    - `error` string
    - `expires_at` string
    - `message` string
    - `success` boolean
    - `token_type` string

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `404` — Not Found

---

[API](https://skmtc.net/frain-dev/apis/convoy-api-reference.md) · [All operations](https://skmtc.net/frain-dev/apis/convoy-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/frain-dev/convoy-api-reference/versions/dbd5b4f9cf13/schema)
