openapi: 3.1.0 info: title: JobSurfing Public API version: "1.0.0" summary: Read the job postings of learning companies, for partners of JobSurfing. description: | The public API of JobSurfing for partners (epic JS-1569). It is separate from the API the JobSurfing app uses and it is versioned: the major version is in the path (`/v1/`), and within a major version changes are additive only (new endpoints, new optional fields, new enum values a client must tolerate). A previous major version stays available for at least 12 months after the next one, announced with the `Deprecation` and `Sunset` headers. **Authentication**: OAuth 2.0 client credentials. A partner receives a client id and a client secret from JobSurfing, asks a token with HTTP Basic authentication, and sends that token as a Bearer token. A token is valid for two hours and has no refresh token: ask a new one with the same credentials when it expires. Requests are accepted from the partner's registered IP addresses only. **Rate limit**: per client, 300 requests per minute unless agreed otherwise. Every answer carries the `RateLimit-*` headers; a request over the limit answers 429 with `Retry-After`. **Request id**: every answer carries `X-Request-Id`. Send one of your own and it is taken over; otherwise JobSurfing makes one. Every call of a client is recorded under it, so quote it when you contact us about a call. **Errors** are Problem Details (RFC 9457) with a stable machine-readable `code`. contact: name: JobSurfing email: support@jobsurfing.nl servers: - url: https://api.jobsurfing.nl/v1 description: Production security: - clientCredentials: [job-postings:read] tags: - name: Job postings description: Job postings of a learning company, by its KvK establishment number (vestigingsnummer). - name: Service description: The state of the API itself. paths: /establishments/{establishmentNumber}/job-postings: get: tags: [Job postings] operationId: listEstablishmentJobPostings summary: The open job postings of an establishment description: | All job postings the establishment has published and that are open now, of every learning company at that establishment: an organisation with its teams or locations, or one under a new KvK number after a change of legal form. An establishment JobSurfing does not know answers 404 `establishment.unknown`; that is an ordinary answer, not a fault (most establishment numbers a partner holds are not on JobSurfing). An establishment without open job postings answers 200 with an empty list. The list is always complete: this endpoint has no pages. parameters: - $ref: '#/components/parameters/EstablishmentNumber' - $ref: '#/components/parameters/RequestId' responses: '200': description: The open job postings of the establishment. headers: API-Version: { $ref: '#/components/headers/ApiVersion' } X-Request-Id: { $ref: '#/components/headers/XRequestId' } RateLimit-Limit: { $ref: '#/components/headers/RateLimitLimit' } RateLimit-Remaining: { $ref: '#/components/headers/RateLimitRemaining' } RateLimit-Reset: { $ref: '#/components/headers/RateLimitReset' } content: application/json: schema: type: object required: [data, meta] properties: data: type: array items: { $ref: '#/components/schemas/JobPosting' } meta: type: object required: [establishment, count] properties: establishment: { $ref: '#/components/schemas/Establishment' } count: { type: integer, minimum: 0 } '401': { $ref: '#/components/responses/Unauthorized' } '403': { $ref: '#/components/responses/Forbidden' } '404': description: JobSurfing does not know this establishment (`establishment.unknown`), or the number is malformed (`establishment.invalid`). headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } content: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } example: { type: 'https://developers.jobsurfing.nl/problems/establishment.unknown', title: Establishment unknown, status: 404, code: establishment.unknown } '429': { $ref: '#/components/responses/TooManyRequests' } /job-postings/{jobPostingId}: get: tags: [Job postings] operationId: getJobPosting summary: One job posting description: An open job posting by its id. A job posting that is closed or withdrawn answers 404 `job_posting.unknown`. parameters: - $ref: '#/components/parameters/JobPostingId' - $ref: '#/components/parameters/RequestId' responses: '200': description: The job posting. headers: API-Version: { $ref: '#/components/headers/ApiVersion' } X-Request-Id: { $ref: '#/components/headers/XRequestId' } RateLimit-Limit: { $ref: '#/components/headers/RateLimitLimit' } RateLimit-Remaining: { $ref: '#/components/headers/RateLimitRemaining' } RateLimit-Reset: { $ref: '#/components/headers/RateLimitReset' } content: application/json: schema: type: object required: [data] properties: data: { $ref: '#/components/schemas/JobPosting' } '401': { $ref: '#/components/responses/Unauthorized' } '403': { $ref: '#/components/responses/Forbidden' } '404': description: No open job posting with this id (`job_posting.unknown`). headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } content: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } '429': { $ref: '#/components/responses/TooManyRequests' } /health: get: tags: [Service] operationId: getHealth summary: Whether the API can answer description: Answers 200 when the API reaches its database (one query), 503 when it does not. No token needed. security: [] parameters: - $ref: '#/components/parameters/RequestId' responses: '200': description: The API and its database answer. headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } content: application/json: schema: type: object required: [status] properties: status: { type: string, enum: [ok] } '503': description: The database does not answer (`service.unavailable`). headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } content: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } components: securitySchemes: clientCredentials: type: oauth2 description: | `POST https://api.jobsurfing.nl/v1/oauth/token` with `Authorization: Basic base64(client_id:client_secret)` and the form body `grant_type=client_credentials`. The credentials are refused in the body or the query string. Answer: `{"access_token": "...", "token_type": "bearer", "expires_in": 7200}`. Errors of the token endpoint are OAuth's own (RFC 6749 §5.2), not Problem Details: `{"error": "invalid_client", "error_description": "..."}` with 401 for wrong credentials or an address that is not registered, 400 with `invalid_request`, `unsupported_grant_type` or `unauthorized_client` (the client may not use the API at present), 429 with `slow_down`. flows: clientCredentials: tokenUrl: https://api.jobsurfing.nl/v1/oauth/token scopes: job-postings:read: Read the open job postings of establishments. parameters: EstablishmentNumber: name: establishmentNumber in: path required: true description: The KvK establishment number (vestigingsnummer), 12 digits; leading zeros may be left out. schema: { type: string, pattern: '^[0-9]{1,12}$' } example: '000012345678' JobPostingId: name: jobPostingId in: path required: true description: The id of a job posting as this API gives it. Opaque; do not derive anything from it. schema: { type: string, minLength: 1, maxLength: 64 } RequestId: name: X-Request-Id in: header required: false description: An id of your own for this request, taken over in the answer and in the record of the call. schema: { type: string, minLength: 1, maxLength: 64, pattern: '^[A-Za-z0-9._:-]+$' } headers: XRequestId: description: The id of this request — the one the client sent, or one JobSurfing made. schema: { type: string } ApiVersion: description: The version of the API that answered, `major.minor.patch`. schema: { type: string, example: '1.0.0' } RateLimitLimit: description: Requests allowed per minute for this client (300 unless agreed otherwise). schema: { type: integer } RateLimitRemaining: description: Requests left in the current one-minute window. schema: { type: integer } RateLimitReset: description: Seconds until the current one-minute window resets. schema: { type: integer } responses: Unauthorized: description: No token, an expired or revoked token, or a token that is not a client token (`auth.invalid_token`). headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } content: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } Forbidden: description: The client lacks the scope for this endpoint (`auth.insufficient_scope`), or calls from an address that is not registered (`auth.address_not_allowed`). headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } content: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } TooManyRequests: description: Over the rate limit of this client (`rate_limit.exceeded`); see `Retry-After`. headers: X-Request-Id: { $ref: '#/components/headers/XRequestId' } Retry-After: description: Seconds to wait before the next request. schema: { type: integer } content: application/problem+json: schema: { $ref: '#/components/schemas/Problem' } schemas: JobPosting: type: object required: [id, title, type, establishment, workLocation, url, publishedAt, updatedAt] properties: id: type: string description: Opaque id of the job posting. title: type: string description: The job posting's own title, or else the name of its profession. example: Stagiair keuken type: type: string enum: [internship, temporary, permanent] description: An internship (stage/BPV), a temporary job or a permanent job. Tolerate values added later. summary: type: [string, 'null'] description: One line about the job posting. description: type: [string, 'null'] description: | The free text of the job posting as plain text, without markup; paragraphs separated by a blank line. Most job postings have none: their content is in the structured fields. hoursPerWeek: $ref: '#/components/schemas/Range' duration: type: [object, 'null'] required: [min, max, unit] properties: min: { type: [number, 'null'] } max: { type: [number, 'null'] } unit: { type: string, enum: [weeks, months] } startDate: type: [string, 'null'] format: date description: When the work starts, if it has a fixed start. qualification: type: [object, 'null'] description: For an internship, the qualification (crebo) the learning company is accredited for by SBB. required: [code, name] properties: code: { type: string, example: '25180' } name: { type: string, example: Kok } establishment: $ref: '#/components/schemas/Establishment' workLocation: type: object required: [city] properties: street: { type: [string, 'null'] } houseNumber: { type: [string, 'null'] } postalCode: { type: [string, 'null'] } city: { type: string } countryCode: { type: string, example: NL } url: type: string format: uri description: Where a candidate reads and responds to the job posting. publishedAt: type: string format: date-time updatedAt: type: string format: date-time description: When anything in this representation last changed; for partners that synchronise. Establishment: type: object description: | A KvK establishment (vestiging). In a job posting it names the learning company as JobSurfing shows it: a team or location of an organisation with the organisation's name first ("Buurtzorg Nederland - Waddinxveen Noord"). In the meta of a list it names the organisation. required: [establishmentNumber, name] properties: establishmentNumber: { type: string, example: '000012345678' } name: { type: string, example: Bakkerij De Korst } Range: type: [object, 'null'] required: [min, max] properties: min: { type: [number, 'null'] } max: { type: [number, 'null'] } Problem: type: object description: Problem Details (RFC 9457) with a stable `code`. required: [type, title, status, code] properties: type: { type: string, format: uri } title: { type: string } status: { type: integer } code: { type: string, description: 'Stable, machine-readable: establishment.unknown, job_posting.unknown, service.unavailable, auth.invalid_token, auth.insufficient_scope, auth.address_not_allowed, rate_limit.exceeded, ...' } detail: { type: string }