Skip to content
中文

Retire a job

Code Mode: praxis.workforce.jobs.retire.create

HTTP: POST /workforce/v1/jobs/{id}/retire

Retires a job so no new position can be opened from it; positions already opened are unchanged. Retiring a job that is already retired returns it unchanged. Takes no body. Requires an organization owner or admin. Errors: 403 PERMISSION_DENIED; 404 JOB_NOT_FOUND.

Signature

praxis.workforce.jobs.retire.create(args:{path:{id:string}}):Promise<{/** Job id (jpr_...); use it as job_id when opening positions. */ id:string;/** Id of the organization that owns the job. */ organization_id:string;/** Your own key for the job; unique inside the organization and fixed after creation. */ code:string;/** Job name, 1 to 100 characters; becomes the default title of positions opened from it. */ name:string;/** What the job is responsible for; copied onto positions when they are opened, at most 4000 characters. */ duties:string;/** How the work is done; copied onto positions when they are opened, at most 4000 characters. */ methods:string;/** Ids of the job levels (lvl_...) positions of this job may carry; an empty array allows any level. */ level_ids:Array<string>;/** Revision number, starting at 1 and rising on every revise; send it as expected_revision. */ revision:number;/** Whether the job can open new positions. */ status:"active"|"retired";/** UTC instant (RFC 3339) when the job was defined. */ create_time:string;/** UTC instant (RFC 3339) of the latest change to the job. */ update_time:string}>;

Parameters

NameInTypeRequiredDescription
idpathstringyesJob id (jpr_…) to retire, from the jobs list.

Responses

StatusContent typesDescription
200application/jsonThe job with status retired.
401Missing or invalid credential; provide a valid organization API key or sign in to the Console.
403application/problem+jsonPERMISSION_DENIED; an organization owner or admin may call this, and machine tokens are always refused (an agent’s session token may read the organization, never change it). Use an API key or Console session of an allowed role.
404application/problem+jsonJOB_NOT_FOUND; list jobs and copy an id of your organization.