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

# Add or Update Portal Candidate

> Add a candidate to a Client Portal, or update one already on it. Other candidates are never changed. Returns 201 when added and 200 when updated. A new candidate shows their latest completed result for the job's problem unless includeResult is false.

**Required scope:** `client_portals:write`



## OpenAPI

````yaml https://api.ropes.ai/api/docs/openapi.json put /api/public/client-portals/{portalId}/candidates/{candidateId}
openapi: 3.0.0
info:
  title: Ropes Public API
  version: 1.0.0
  description: >-
    Public API for Ropes. Authenticate using your API key in the x-api-key
    header.
servers:
  - url: https://api.ropes.ai
    description: Production server
  - url: http://localhost:3001
    description: Local development server
security: []
paths:
  /api/public/client-portals/{portalId}/candidates/{candidateId}:
    put:
      tags:
        - Client Portals
      summary: Add or Update Portal Candidate
      description: >-
        Add a candidate to a Client Portal, or update one already on it. Other
        candidates are never changed. Returns 201 when added and 200 when
        updated. A new candidate shows their latest completed result for the
        job's problem unless includeResult is false.


        **Required scope:** `client_portals:write`
      parameters:
        - schema:
            type: string
            description: The Client Portal identifier
          required: true
          description: The Client Portal identifier
          name: portalId
          in: path
        - schema:
            type: string
            description: The candidate's identifier
          required: true
          description: The candidate's identifier
          name: candidateId
          in: path
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertPortalCandidateRequest'
      responses:
        '200':
          description: Candidate updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalCandidateResponse'
        '201':
          description: Candidate added
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PortalCandidateResponse'
        '400':
          description: Invalid body, e.g. a submittal field is too long
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Forbidden - API key is missing the required scope
        '404':
          description: Client Portal or candidate not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: The portal covers more than one job; manage it in Ropes
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Rate limit exceeded - contact support@ropes.ai for further
            assistance.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - ApiKeyAuth: []
components:
  schemas:
    UpsertPortalCandidateRequest:
      type: object
      properties:
        includeResult:
          type: boolean
          description: >-
            true shows the candidate's latest completed result for the job's
            problem, false hides it. Omitted: on, for a new candidate; unchanged
            otherwise.
        submittal:
          type: object
          properties:
            pitch:
              type: string
              nullable: true
              maxLength: 1000
              description: Why this candidate fits the job
            availability:
              type: string
              nullable: true
              maxLength: 120
              description: e.g. 2 weeks notice
            compensation:
              type: string
              nullable: true
              maxLength: 120
              description: e.g. $185k base
            workAuthorization:
              type: string
              nullable: true
              maxLength: 120
              description: e.g. US Citizen
            workSetup:
              type: string
              nullable: true
              maxLength: 120
              description: e.g. Hybrid, NYC
          additionalProperties: false
          description: Omitted fields keep their saved value; null clears one
        notifyReviewers:
          type: boolean
          default: false
          description: Email the portal's hiring managers when this adds a new candidate
      additionalProperties: false
    PortalCandidateResponse:
      type: object
      properties:
        created:
          type: boolean
          description: true when the candidate was added, false when updated
        candidate:
          $ref: '#/components/schemas/PortalCandidate'
      required:
        - created
        - candidate
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        message:
          type: string
          description: Error message (alternative field)
    PortalCandidate:
      type: object
      properties:
        candidateId:
          type: string
          description: The candidate's identifier
        name:
          type: string
        email:
          type: string
          nullable: true
        jobId:
          type: string
          nullable: true
          format: uuid
          description: >-
            The job this entry is on. Older portals can cover several jobs; a
            candidate on two of them appears once per job.
        problemId:
          type: string
          nullable: true
          description: The job's problem, if any
        resultInterviewId:
          type: string
          nullable: true
          description: The assessment result the hiring manager sees, if any
        submittal:
          $ref: '#/components/schemas/PortalSubmittal'
        addedAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
      required:
        - candidateId
        - name
        - email
        - jobId
        - problemId
        - resultInterviewId
        - submittal
        - addedAt
        - updatedAt
    PortalSubmittal:
      type: object
      properties:
        pitch:
          type: string
          nullable: true
          maxLength: 1000
          description: Why this candidate fits the job
        availability:
          type: string
          nullable: true
          maxLength: 120
          description: e.g. 2 weeks notice
        compensation:
          type: string
          nullable: true
          maxLength: 120
          description: e.g. $185k base
        workAuthorization:
          type: string
          nullable: true
          maxLength: 120
          description: e.g. US Citizen
        workSetup:
          type: string
          nullable: true
          maxLength: 120
          description: e.g. Hybrid, NYC
      required:
        - pitch
        - availability
        - compensation
        - workAuthorization
        - workSetup
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        Each key carries scopes chosen when it is created: `candidates:read`,
        `candidates:write`, `assessments:read`, `assessments:write`,
        `problems:read`, `problems:write`, `results:read`, `id_checks:read`,
        `id_checks:write`, `jobs:read`, `jobs:write`, `client_portals:read`,
        `client_portals:write`. Keys created before scopes existed have full
        access. A request with a key that lacks an operation's scope returns 403
        naming the missing scope.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.