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

# Invite Team User

> Invites a team admin or member by email.

Track pending invitations with `GET /api/v1/users?status=pending`.




## OpenAPI

````yaml /openapi.yaml post /api/v1/users/invitations
openapi: 3.0.3
info:
  title: Folkyn API
  version: 1.0.0
  license:
    name: Proprietary
    url: https://folkyn.com
  description: >-
    Team API key; responses in `data`, errors in `error` with `X-Request-Id`.
    Spec at `/api/v1/openapi.yaml` and `/api/v1/openapi.json` (no key). **60
    requests/minute** per key on `/api/v1/*`.
servers:
  - url: https://api.folkyn.com
    description: Production
security:
  - bearerAuth: []
  - ApiKeyHeader: []
tags:
  - name: Specification
    description: OpenAPI document download (no authentication)
  - name: Project codes
    description: Team project codes
  - name: Team tags
    description: Team tags
  - name: Teams
    description: Organizational teams (team units) and member lists
  - name: Missions
    description: Team missions
  - name: Freelancers
    description: Team freelancers and invitations
  - name: Activity reports
    description: Activity reports (CRA)
  - name: Accounting
    description: Accounting entries
paths:
  /api/v1/users/invitations:
    post:
      tags:
        - Users
      summary: Invite Team User
      description: |
        Invites a team admin or member by email.

        Track pending invitations with `GET /api/v1/users?status=pending`.
      operationId: inviteUser
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UserInvitationCreateRequest'
            example:
              email: admin@example.com
              first_name: Alex
              last_name: Martin
              role: team-admin
              job_title: HR Manager
              invite_locale: fr
      responses:
        '201':
          description: Invitation created
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/UserInvitationCreated'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicError'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/ForbiddenError'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  schemas:
    UserInvitationCreateRequest:
      type: object
      required:
        - email
        - first_name
        - last_name
        - role
      properties:
        email:
          type: string
          format: email
        first_name:
          type: string
        last_name:
          type: string
        role:
          type: string
          enum:
            - team-admin
            - team-member
        job_title:
          type: string
        tag_ids:
          type: array
          items:
            type: string
            format: uuid
        team_ids:
          type: array
          maxItems: 1
          description: >-
            Organizational team UUID on the invitation. At most one team per
            person.
          items:
            type: string
            format: uuid
        invited_by_member_id:
          type: string
          format: uuid
          description: >-
            Team member profile UUID shown as email sender; defaults to first
            active team-admin.
        invite_locale:
          type: string
          enum:
            - fr
            - en
    UserInvitationCreated:
      type: object
      required:
        - invitation_id
        - email
        - status
        - email_sent
        - role
        - resent
      properties:
        invitation_id:
          type: string
          format: uuid
        email:
          type: string
          format: email
        status:
          type: string
          enum:
            - pending
        email_sent:
          type: boolean
        role:
          type: string
          enum:
            - team-admin
            - team-member
        resent:
          type: boolean
          description: >-
            True when an existing pending invitation was updated and the email
            was resent.
    PublicError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: integer
              description: Same as HTTP status; use `message` and `details` to narrow.
              enum:
                - 400
                - 401
                - 403
                - 404
                - 429
                - 500
              example: 401
            message:
              type: string
            request_id:
              type: string
              format: uuid
              description: Correlates with the X-Request-Id response header.
            details:
              $ref: '#/components/schemas/PublicErrorDetails'
    PublicErrorDetails:
      type: object
      description: Optional structured hints (validation, scope, rate limit).
      additionalProperties: true
      properties:
        reason:
          $ref: '#/components/schemas/PartnerValidationErrorReason'
        field:
          type: string
          description: JSON body field name when applicable (e.g. `name`).
          example: name
        requiredScope:
          type: string
          description: >-
            Required OAuth-like scope string when `code` is 403 (insufficient
            scope).
          example: tags:write
        retryAfterSeconds:
          type: integer
          minimum: 0
          description: Hint when `code` is 429.
    PartnerValidationErrorReason:
      type: string
      description: >-
        Machine-readable validation subtype (HTTP 400) for create tag / project
        code.
      enum:
        - invalid_json
        - required_field
        - duplicate_name
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
    ForbiddenError:
      description: Insufficient scope or forbidden
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
    RateLimited:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
    InternalError:
      description: Server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer <your_api_key>`'
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-Api-Key

````