> ## 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.

# Create Client Portal

> Create the Client Portal for a client and a job. A client has one portal per job: creating it again returns 409 with the existing portal. To share a candidate with a hiring manager: create (or find) the client, the job and the candidate, create the portal for that client and job, add the candidate, then invite the hiring manager.

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



## OpenAPI

````yaml https://api.ropes.ai/api/docs/openapi.json post /api/public/client-portals
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:
    post:
      tags:
        - Client Portals
      summary: Create Client Portal
      description: >-
        Create the Client Portal for a client and a job. A client has one portal
        per job: creating it again returns 409 with the existing portal. To
        share a candidate with a hiring manager: create (or find) the client,
        the job and the candidate, create the portal for that client and job,
        add the candidate, then invite the hiring manager.


        **Required scope:** `client_portals:write`
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateClientPortalRequest'
      responses:
        '201':
          description: Client Portal created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientPortalResponse'
        '400':
          description: >-
            Invalid body, client or job not found, or ownerEmail is not a user
            in your organization
          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
        '409':
          description: The client already has a portal for this job; existing holds it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ClientPortalConflictResponse'
        '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:
    CreateClientPortalRequest:
      type: object
      properties:
        clientId:
          type: string
          minLength: 1
        jobId:
          type: string
          minLength: 1
        ownerEmail:
          type: string
          maxLength: 320
          format: email
          description: >-
            A user in your organization who receives hiring manager feedback.
            Defaults to the client's owner.
      required:
        - clientId
        - jobId
      additionalProperties: false
    ClientPortalResponse:
      type: object
      properties:
        portal:
          $ref: '#/components/schemas/ClientPortalDetail'
      required:
        - portal
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        message:
          type: string
          description: Error message (alternative field)
    ClientPortalConflictResponse:
      type: object
      properties:
        error:
          type: string
        existing:
          $ref: '#/components/schemas/ClientPortalDetail'
      required:
        - error
    ClientPortalDetail:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the portal
        name:
          type: string
        url:
          type: string
          description: Link the hiring manager opens; they sign in with their invited email
        status:
          type: string
          description: active or draft
        clientId:
          type: string
          nullable: true
          format: uuid
        jobId:
          type: string
          nullable: true
          format: uuid
          description: >-
            The portal's job. Portals created through the API have one job;
            older portals with several report the first.
        problemId:
          type: string
          nullable: true
          description: The job's problem; candidates' results for it can show
        jobCount:
          type: number
          description: Number of jobs on the portal
        ownerEmail:
          type: string
          nullable: true
        candidateCount:
          type: number
        reviewerCount:
          type: number
        createdAt:
          type: string
          format: date-time
        updatedAt:
          type: string
          format: date-time
        candidates:
          type: array
          items:
            $ref: '#/components/schemas/PortalCandidate'
        reviewers:
          type: array
          items:
            $ref: '#/components/schemas/PortalReviewer'
      required:
        - id
        - name
        - url
        - status
        - clientId
        - jobId
        - problemId
        - jobCount
        - ownerEmail
        - candidateCount
        - reviewerCount
        - createdAt
        - updatedAt
        - candidates
        - reviewers
    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
    PortalReviewer:
      type: object
      properties:
        email:
          type: string
          description: Hiring manager email
        invitedAt:
          type: string
          format: date-time
      required:
        - email
        - invitedAt
    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.