Files
lincodex/api/core/routes/consents.yml
T

46 lines
2.9 KiB
YAML

get:
operationId: ListMyConsents
summary: List the consents of the current account with their history.
description: |-
Requires the session cookie of a candidate or an employer account. The subject comes from the session, never from a request parameter, so the response holds only the caller's own consents: no request can name another account, and records of other accounts are never listed. Returns a page of the consent ledger of the account, newest grant first with the identifier as the tie-breaker, with cursor pagination.
The ledger is append-only. Every grant is a record with its purpose, the accepted text version, the source, and the grant time; the server also stores the hash of exactly the text the subject saw. A newer text version of the same purpose is a new record, and the earlier one becomes `superseded` without any change. A revocation stamps every unrevoked record of the purpose, and for c4 of one organization, once; a later grant is a new record. Purposes are independent.
Without `state` the page lists the whole history; `state=active` lists the consents that hold now, one per purpose for c1, c2, c3, and c5 and one per accepted invitation for c4. A c4 record names the organization with the name its consent text showed (a snapshot that a later rename does not change), the selected contact fields, and the invitation with its terms version; it never carries a contact value. A c2 record proves the consent to the publication text; the published field set and its changes are evidence of the publication history (TASK-088).
Granting c1, c2, c3, and c5 in the consent settings and revoking any purpose are planned operations of this tag (TASK-063 and TASK-064); c1 is given at registration and c4 only in AcceptMyInvitation.
Access: a missing, unknown, expired, or revoked session answers 401 unauthenticated. A malformed `limit`, `cursor`, or `state` answers 400 validation_failed.
security:
- sessionCookie: []
tags:
- consent
parameters:
- name: state
in: query
required: false
description: Lists only the records in this state; omit it for the whole history.
schema:
$ref: ../components/schemas.yml#/ConsentState
- $ref: ../components/parameters.yml#/PageLimit
- $ref: ../components/parameters.yml#/PageCursor
responses:
"200":
description: A page of the consent ledger of the current account.
headers:
Cache-Control:
$ref: ../components/headers.yml#/CacheControlNoStore
content:
application/json:
schema:
$ref: ../components/schemas.yml#/ConsentRecordList
examples:
history:
$ref: ../components/examples.yml#/ConsentRecordListPage
"400":
$ref: ../components/responses.yml#/ValidationFailed
"401":
$ref: ../components/responses.yml#/Unauthenticated
default:
$ref: ../components/responses.yml#/Problem