> ## Documentation Index
> Fetch the complete documentation index at: https://docs.junction.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create Org Prepare Team Custom Credentials

> Create or submit org prepare team custom credentials via the Junction API. Requires authentication with your team API key.

<Info>
  [Junction Management API](/api-details/junction-management-api) is available for [the Scale plan](https://tryvital.io/pricing).
</Info>

<Tip>
  The base URL of this endpoint is `https://api.management.junction.com/`.

  The endpoint accepts only [Management Key](/api-details/junction-management-api#authentication) (`X-Management-Key`).
  Team API Key is not accepted.
</Tip>

<RequestExample>
  ```bash cURL theme={null}
  curl --request GET \
    --url https://api.management.junction.com/v1/org/{org_id}/prepare_team_custom_credentials/{env}/{region} \
    --header 'X-Vital-Org-Key: <api-key>'
  ```
</RequestExample>


## OpenAPI

````yaml POST /v1/org/{org_id}/prepare_team_custom_credentials/{env}/{region}
openapi: 3.1.0
info:
  title: Org Management
  version: 0.1.0
servers:
  - url: https://api.management.junction.com
    description: Production Management API server
security:
  - ManagementKey: []
paths:
  /v1/org/{org_id}/prepare_team_custom_credentials/{env}/{region}:
    post:
      tags:
        - Team Custom Credentials
      summary: Prepare Team Custom Credentials
      operationId: >-
        prepare_team_custom_credentials_v1_org__org_id__prepare_team_custom_credentials__env___region__post
      parameters:
        - name: org_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Org Id
        - name: env
          in: path
          required: true
          schema:
            $ref: '#/components/schemas/Env'
        - name: region
          in: path
          required: true
          schema:
            type: string
            enum:
              - us
              - eu
            title: Region
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PrepareTeamCustomCredentialsBody'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrepareTeamCustomCredentialsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    Env:
      type: string
      enum:
        - production
        - sandbox
      title: Env
    PrepareTeamCustomCredentialsBody:
      properties:
        team_id:
          type: string
          format: uuid
          title: Team Id
        provider:
          anyOf:
            - $ref: '#/components/schemas/Providers'
            - $ref: '#/components/schemas/Labs'
          title: Provider
      type: object
      required:
        - team_id
        - provider
      title: PrepareTeamCustomCredentialsBody
    PrepareTeamCustomCredentialsResponse:
      properties:
        status:
          type: string
          enum:
            - no_action_needed
            - preparations_required
          title: Status
          description: >-
            ### `no_action_needed`

            No preparation needs to be done.

            You can apply the custom credential using the Set Team Custom
            Credentials API

            right away.


            ### `preparations_required`

            You should configure your OAuth application in accordance to the
            preparation steps

            provided, before calling the Set Team Custom Credentials API to

            apply the custom credential to your team.
        preparation_steps:
          items:
            $ref: '#/components/schemas/CustomCredentialPreparationStep'
          type: array
          title: Preparation Steps
          description: |-
            A list of steps which must be completed before applying the custom
            credential to your team through the Set Team Custom Credentials API.
      type: object
      required:
        - status
      title: PrepareTeamCustomCredentialsResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Providers:
      type: string
      enum:
        - oura
        - fitbit
        - garmin
        - whoop
        - strava
        - renpho
        - peloton
        - wahoo
        - zwift
        - freestyle_libre
        - abbott_libreview
        - tandem_source
        - freestyle_libre_ble
        - eight_sleep
        - withings
        - apple_health_kit
        - manual
        - ihealth
        - google_fit
        - beurer_api
        - beurer_ble
        - omron
        - omron_ble
        - onetouch_ble
        - accuchek_ble
        - contour_ble
        - dexcom
        - dexcom_v3
        - hammerhead
        - my_fitness_pal
        - health_connect
        - samsung_health
        - polar
        - cronometer
        - kardia
        - whoop_v2
        - ultrahuman
        - my_fitness_pal_v2
        - map_my_fitness
        - runkeeper
      title: Providers
    Labs:
      type: string
      enum:
        - ayumetrix
        - spiriplex
        - ussl
        - quest
        - sonora_quest
        - labcorp
        - bioreference
        - us_biotek
        - manual
        - sanocardio
        - ihd
        - nexus
        - my_uti
        - crl
      title: Labs
    CustomCredentialPreparationStep:
      properties:
        type:
          type: string
          enum:
            - redirect_uri
            - webhook_uri
          title: Type
        key:
          anyOf:
            - type: string
            - type: 'null'
          title: Key
        value:
          type: string
          title: Value
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - type
        - key
        - value
        - description
      title: CustomCredentialPreparationStep
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ManagementKey:
      type: apiKey
      in: header
      name: X-Management-Key

````