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

# Update Athlete

> Use this endpoint to update an athlete's attributes. You can modify all attributes, following specific rules for certain fields and custom attributes. Include only the attributes you wish to update or new custom attributes to add in the request body.

#### Attribute Modification

All attributes of the athlete can be updated. Include only the attributes you wish to change — omitted attributes are left unchanged. The following rules apply:

* **String Attributes**:
  * String values can be updated to any non-empty string.
  * String values can be set to an empty string (`""`) or `null` to clear the attribute.

* **Integer Attributes**:
  * Integer values can be updated to any valid integer.
  * Integer values can be set to `0` or `null` to clear the attribute.

* **Special Rules for `first_name`**:
  * The `first_name` attribute, if included, cannot be empty. It must always contain a non-empty string.

* **Custom Attributes (`custom_attributes`)**:
  * Updates are merged with the athlete's existing custom attributes:
    * Keys omitted from the request are left unchanged.
    * Keys set to a non-empty string are created or updated.
    * Keys set to `null` are deleted from the `custom_attributes` object.
  * Empty strings (`""`) and non-string values are not valid custom attribute values and return a `400` error.
  * New custom attributes must follow the same key rules as described in the `createAthlete` endpoint.

#### Example Request

```json theme={null}
POST /athletes/12345

{
  "last_name": "",
  "email": "john@example.com",
  "weight": 0,
  "custom_attributes": {
    "team": "Team B",
    "position": "pitcher",
    "sport": null
  }
}
```

In this example, `last_name` and `weight` are cleared, `email` is updated, the `team` and `position` custom attributes are created or updated, and the `sport` custom attribute is deleted.


## OpenAPI

````yaml POST /athletes/{athleteId}
openapi: 3.0.0
info:
  title: Uplift SQL API
  version: v1
  description: >-
    API for submitting SQL queries and retrieving job IDs for the Uplift
    platform.
servers:
  - url: https://api.uplift.ai/v1
security: []
paths:
  /athletes/{athleteId}:
    post:
      tags:
        - Athlete Management
      summary: Update Athlete in Organization
      description: >-
        Use this endpoint to update an athlete's attributes. You can modify all
        attributes, following specific rules for certain fields and custom
        attributes. Include only the attributes you wish to update or new custom
        attributes to add in the request body.
      parameters:
        - name: athleteId
          in: path
          required: true
          description: The unique identifier for the athlete record to be retrieved.
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                first_name:
                  type: string
                  description: |-
                    The first name of the athlete.

                    **Note:** This is the minimum required field.
                last_name:
                  type: string
                  description: The last name of the athlete.
                date_of_birth:
                  type: string
                  description: >-
                    The date of birth of the athlete, formatted as
                    **_YYYY-MM-DD_**
                email:
                  type: string
                  description: The athlete's email address.
                phone:
                  type: string
                  description: The athlete's phone number.
                gender:
                  type: string
                  enum:
                    - male
                    - female
                    - non-binary
                    - prefer_not_to_say
                  description: >-
                    The athlete's gender. Allowed values: male, female,
                    non-binary, prefer_not_to_say.
                height:
                  type: integer
                  description: The height of the athlete, in inches.
                weight:
                  type: integer
                  description: The weight of the athlete, in pounds (lbs).
                dominant_arm:
                  type: string
                  enum:
                    - left
                    - right
                    - both
                  description: 'Dominant arm. Allowed values: left, right, both.'
                dominant_leg:
                  type: string
                  enum:
                    - left
                    - right
                    - both
                  description: 'Dominant leg. Allowed values: left, right, both.'
                activity:
                  type: string
                  enum:
                    - baseball
                    - softball
                    - tennis
                    - basketball
                    - golf
                  description: >-
                    Primary sport or activity. Allowed values: baseball,
                    softball, tennis, basketball, golf.
                positions:
                  type: array
                  items:
                    type: string
                  description: >-
                    Positions for the athlete's activity. Requires activity to
                    be set. baseball/softball: pitcher, catcher, first_base,
                    second_base, third_base, shortstop, left_field,
                    center_field, right_field, designated_hitter. basketball:
                    point_guard, shooting_guard, small_forward, power_forward,
                    center.
                competition_level:
                  type: string
                  enum:
                    - youth
                    - high_school
                    - college
                    - professional
                  description: >-
                    Competition level. Allowed values: youth, high_school,
                    college, professional.
                custom_attributes:
                  type: object
                  description: >-
                    A set of custom key-value attributes, merged with the
                    athlete's existing custom attributes. _Keys_ must be
                    strings, and _values_ must be non-empty strings or `null`.
                    Keys omitted from the request are left unchanged, keys set
                    to a non-empty string are created or updated, and keys set
                    to `null` are deleted.
                  additionalProperties:
                    type: string
                    nullable: true
      responses:
        '200':
          description: Athlete updated successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  athlete:
                    $ref: '#/components/schemas/Athlete'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/TooManyRequests'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - bearerAuth: []
components:
  schemas:
    Athlete:
      type: object
      properties:
        id:
          type: string
          description: The unique identifier for the athlete.
        first_name:
          type: string
          description: The first name of the athlete.
        last_name:
          type: string
          description: The last name of the athlete.
        date_of_birth:
          type: string
          format: date-time
          description: The date of birth of the athlete.
        email:
          type: string
          description: The athlete's email address.
        phone:
          type: string
          description: The athlete's phone number.
        gender:
          type: string
          enum:
            - male
            - female
            - non-binary
            - prefer_not_to_say
          description: >-
            The athlete's gender. Allowed values: male, female, non-binary,
            prefer_not_to_say.
        dominant_arm:
          type: string
          enum:
            - left
            - right
            - both
          description: 'Dominant arm. Allowed values: left, right, both.'
        dominant_leg:
          type: string
          enum:
            - left
            - right
            - both
          description: 'Dominant leg. Allowed values: left, right, both.'
        activity:
          type: string
          enum:
            - baseball
            - softball
            - tennis
            - basketball
            - golf
          description: >-
            Primary sport or activity. Allowed values: baseball, softball,
            tennis, basketball, golf.
        positions:
          type: array
          items:
            type: string
          description: >-
            Positions for the athlete's activity. Requires activity to be set.
            Allowed values depend on activity: baseball and softball: pitcher,
            catcher, first_base, second_base, third_base, shortstop, left_field,
            center_field, right_field, designated_hitter. basketball:
            point_guard, shooting_guard, small_forward, power_forward, center.
            tennis and golf have no positions.
        competition_level:
          type: string
          enum:
            - youth
            - high_school
            - college
            - professional
          description: >-
            Competition level. Allowed values: youth, high_school, college,
            professional.
        height:
          type: integer
          description: The height of the athlete, in inches.
        weight:
          type: integer
          description: The weight of the athlete, in pounds (lbs).
        custom_attributes:
          type: object
          description: >-
            A set of custom key-value attributes. Keys must be strings, and
            values must also be strings.
          additionalProperties:
            type: string
        created_at:
          type: string
          format: date-time
          description: The timestamp when the athlete record was created.
        updated_at:
          type: string
          format: date-time
          description: The timestamp when the athlete record was last updated.
    Error:
      type: object
      properties:
        error:
          type: string
          description: A short error code representing the type of error.
        message:
          type: string
          description: A detailed message explaining the error.
        messages:
          type: string
          description: >-
            Create Capture only: validation detail. Multiple issues are joined
            with `; `.
  responses:
    BadRequest:
      description: Invalid request parameters.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: BadRequest
            message: >-
              The request parameters are invalid. Please review the request and
              try again.
    Unauthorized:
      description: Unauthorized. Bearer token is missing or invalid.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
            message: Bearer token is missing or invalid.
    Forbidden:
      description: Forbidden. You do not have permission to access this resource.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Forbidden
            message: You do not have permission to access this resource.
    TooManyRequests:
      description: Too Many Requests. The rate limit has been exceeded.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: TooManyRequests
            message: The rate limit has been exceeded. Please wait and try again later.
    InternalServerError:
      description: Internal Server Error. Something went wrong on the server.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: InternalServerError
            message: >-
              An unexpected error occurred on the server. Please try again
              later.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````