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

# Create a project credential

> Create a login or inbox credential for a project. Passwords are not returned.



## OpenAPI

````yaml /openapi.json post /v1/projects/{projectId}/credentials
openapi: 3.0.0
info:
  title: TestArmy API
  version: 1.0.0
  description: >-
    AI-powered browser automation API for QA testing. Automate web testing
    workflows using natural language prompts.
servers:
  - url: https://tester.army/api
    description: Production API server
security: []
paths:
  /v1/projects/{projectId}/credentials:
    post:
      tags:
        - Projects
      summary: Create a project credential
      description: >-
        Create a login or inbox credential for a project. Passwords are not
        returned.
      parameters:
        - schema:
            type: string
            description: Project ID or shortId
          required: true
          description: Project ID or shortId
          name: projectId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              oneOf:
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - login
                    authMethod:
                      type: string
                      enum:
                        - password
                        - google
                        - github
                    label:
                      type: string
                      minLength: 1
                      maxLength: 50
                    description:
                      type: string
                      maxLength: 500
                      description: >-
                        When to use this account: its type, enabled
                        features/plans, and the environments it exists in. The
                        agent reads this when choosing between credentials.
                    username:
                      type: string
                      minLength: 1
                      maxLength: 255
                    password:
                      type: string
                      minLength: 1
                    totpSecret:
                      type: string
                      minLength: 1
                      maxLength: 512
                      description: >-
                        Authenticator (TOTP/MFA) secret: the base32 setup key or
                        otpauth:// URI from the account's MFA enrollment. The
                        agent generates one-time codes from it during runs.
                        Never returned; responses expose only hasTotpSecret.
                  required:
                    - kind
                    - label
                    - username
                    - password
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - login
                    authMethod:
                      type: string
                      enum:
                        - custom
                    label:
                      type: string
                      minLength: 1
                      maxLength: 50
                    description:
                      type: string
                      maxLength: 500
                      description: >-
                        When to use this account: its type, enabled
                        features/plans, and the environments it exists in. The
                        agent reads this when choosing between credentials.
                    authInstructions:
                      type: string
                      minLength: 1
                      maxLength: 4000
                  required:
                    - kind
                    - authMethod
                    - label
                    - authInstructions
                  additionalProperties: false
                - type: object
                  properties:
                    kind:
                      type: string
                      enum:
                        - inbox
                    label:
                      type: string
                      minLength: 1
                      maxLength: 50
                    description:
                      type: string
                      maxLength: 500
                      description: >-
                        When to use this account: its type, enabled
                        features/plans, and the environments it exists in. The
                        agent reads this when choosing between credentials.
                  required:
                    - kind
                    - label
                  additionalProperties: false
      responses:
        '201':
          description: Credential created
          content:
            application/json:
              schema:
                type: object
                properties:
                  credential:
                    $ref: '#/components/schemas/CredentialSummary'
                required:
                  - credential
        '400':
          description: Bad Request - Invalid input parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '429':
          description: Too Many Requests - Usage limit exceeded
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
        '504':
          description: Gateway Timeout - Test execution exceeded time limit
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    description: Error code or type
                  message:
                    type: string
                    description: Human-readable error message
                required:
                  - error
                  - message
      security:
        - bearerAuth: []
components:
  schemas:
    CredentialSummary:
      type: object
      properties:
        id:
          type: string
          format: uuid
        kind:
          type: string
          enum:
            - login
            - inbox
        authMethod:
          type: string
          enum:
            - password
            - google
            - github
            - custom
        label:
          type: string
        description:
          type: string
          nullable: true
        username:
          type: string
        hasAuthInstructions:
          type: boolean
        hasTotpSecret:
          type: boolean
        createdAt:
          type: string
          format: date-time
      required:
        - id
        - kind
        - authMethod
        - label
        - description
        - username
        - hasAuthInstructions
        - hasTotpSecret
        - createdAt
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: API key authentication using Bearer token format

````