{"openapi":"3.1.0","info":{"title":"SDEP - Competent Authority (CA) API","description":"Endpoints for competent authorities to manage areas and to view activities.","version":"PRD-0.0.1-2604241245"},"servers":[{"url":"/api/ca/v1"}],"paths":{"/activities":{"get":{"tags":["ca"],"summary":"Get activities for the currently authenticated competent authority","description":"Get activities for the currently authenticated competent authority. By default, returns all current activities (unlimited), including current records whose lifecycle `status` is `cancelled`. Use optional pagination parameters to limit results.\n\n**Each activity contains:**\n- `activityId`: Functional ID identifying this activity\n- `activityName`: Display name (optional) of the activity\n- `status`: Lifecycle status of the activity: `finished` or `cancelled`\n- `areaId`: Functional ID referencing the area where the activity took place\n- `competentAuthorityId`: Functional ID referencing the competent authority that owns the area\n- `competentAuthorityName`: Display name (optional) of the competent authority\n- `url`: URL of the originating listing/advertisement\n- `address`: Address composite (`thoroughfare`, `locatorDesignatorNumber` (optional), `locatorDesignatorLetter` (optional), `locatorDesignatorAddition` (optional), `postCode`, `postName`, `fullAddress`)\n- `registrationNumber`: Registration number of the address\n- `numberOfGuests`: Number of guests (1-1024)\n- `countryOfGuests`: Array of country codes of guests (each element is ISO 3166-1 alpha-3 or `N/A`; array length equals `numberOfGuests`)\n- `temporal`: Temporal composite (`startDatetime`, `endDatetime`)\n- `platformId`: Functional ID referencing the platform that owns the activity\n- `platformName`: Display name (optional) of the platform\n- `createdAt`: Timestamp when this activity version was created (UTC)","operationId":"getActivityByCompetentAuthority","security":[{"OAuth2ClientCredentials":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of records to skip (default: 0)","default":0,"title":"Offset"},"description":"Number of records to skip (default: 0)"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Maximum number of records to return (default: unlimited, max: 1000 when specified)","title":"Limit"},"description":"Maximum number of records to return (default: unlimited, max: 1000 when specified)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityListResponse"},"example":{"activities":[{"activityId":"550e8400-e29b-41d4-a716-446655440000","activityName":"Amsterdam Summer Rental","status":"finished","areaId":"959a7439-7cad-4009-96ec-353b44723db9","competentAuthorityId":"sdep-ca0363","competentAuthorityName":"Gemeente Amsterdam","url":"http://example.com/amsterdam-myhouse-1","address":{"thoroughfare":"Prinsengracht","locatorDesignatorNumber":263,"postCode":"1016GV","postName":"Amsterdam","fullAddress":"Prinsengracht 263, 1016GV Amsterdam"},"registrationNumber":"REG0001","numberOfGuests":4,"countryOfGuests":["NLD","DEU","BEL","N/A"],"temporal":{"startDatetime":"2025-06-01T14:00:00Z","endDatetime":"2025-06-07T11:00:00Z"},"platformId":"sdep-str01","platformName":"Test STR 01 (interactive usage, persistent)","createdAt":"2025-06-01T12:00:00Z"}]}}}},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"400":{"description":"Bad request - invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"}}}},"/activities/count":{"get":{"tags":["ca"],"summary":"Get activities count for the currently authenticated competent authority (optional, to support pagination)","description":"Get activities count for the currently authenticated competent authority (optional, to support pagination). Counts all current activity records, including those whose lifecycle `status` is `cancelled`.","operationId":"countActivities","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityCountResponse"}}}},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"}},"security":[{"OAuth2ClientCredentials":[]}]}},"/areas":{"post":{"tags":["ca"],"summary":"Submit a single area into the areas collection for the currently authenticated competent authority","description":"Submit a single area into the areas collection for the currently authenticated competent authority.\n\n**ID Pattern:**\n- `areaId`: provided by competent authority as business identifier (optional), otherwise generated as UUID (RFC 9562)\n\n**Versioning:**\n- Same `areaId` can be resubmitted → creates new version with different timestamp\n- Unique constraint: (areaId, createdAt, current authenticated competent authority)\n\n**Limiting:**\n- Max. 1 MiB (1,048,576 bytes) per file\n- This is to ensure predictable performance, reduce abuse risk, and improve overall reliability\n\n**The request contains (multipart/form-data):**\n- `areaId`: Functional ID identifying this area (auto-generated UUID if not provided; alphanumeric with hyphens `^[A-Za-z0-9-]+$`, max 64 chars)\n- `areaName`: Display name (optional, max 64 chars)\n- `regulation`: Regulation type of the area - 'listing', 'activity', or 'all' (optional, defaults to 'all' when not supplied)\n- `file`: Shapefile upload (max 1 MiB)\n\n**The response contains:**\n- `areaId`: Functional ID identifying this area\n- `areaName`: Display name (optional) of the area\n- `regulation`: Regulation type of the area - 'listing', 'activity', or 'all'\n- `filename`: Name of the area shapefile (e.g., 'area.zip')\n- `competentAuthorityId`: Functional ID of the competent authority that owns the area\n- `competentAuthorityName`: Display name (optional) of the competent authority\n- `createdAt`: Timestamp when this area version was created (UTC)","operationId":"postArea","security":[{"OAuth2ClientCredentials":[]}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Area.Request"}}}},"responses":{"201":{"description":"Area created successfully","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaResponse"}}}},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"},"422":{"description":"Validation Error - business rule violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"get":{"tags":["ca"],"summary":"Get areas for the currently authenticated competent authority","description":"Get all areas owned by the currently authenticated competent authority. By default, returns all areas (unlimited). Use optional pagination parameters to limit results.\n\n**Scoping:**\n- Only returns areas belonging to the currently authenticated competent authority (based on JWT client_id)\n\n**Each area contains:**\n- `areaId`: Functional ID identifying this area\n- `areaName`: Display name (optional) of the area\n- `regulation`: Regulation type: 'listing', 'activity', or 'all'\n- `filename`: Name of the area shapefile (e.g., 'area.zip')\n- `competentAuthorityId`: Functional ID of the competent authority that owns the area\n- `competentAuthorityName`: Display name (optional) of the competent authority\n- `createdAt`: Timestamp when this area version was created (UTC)\n\n**Pagination:**\n- `offset`: Number of records to skip (default: 0)\n- `limit`: Maximum number of records to return (default: unlimited)","operationId":"getOwnAreas","security":[{"OAuth2ClientCredentials":[]}],"parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"description":"Number of records to skip (default: 0)","default":0,"title":"Offset"},"description":"Number of records to skip (default: 0)"},{"name":"limit","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1000,"minimum":1},{"type":"null"}],"description":"Maximum number of records to return (default: unlimited, max: 1000 when specified)","title":"Limit"},"description":"Maximum number of records to return (default: unlimited, max: 1000 when specified)"}],"responses":{"200":{"description":"List of areas owned by the authenticated competent authority","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaListResponse"},"example":{"areas":[{"areaId":"959a7439-7cad-4009-96ec-353b44723db9","areaName":"Amsterdam","regulation":"all","filename":"Amsterdam.zip","competentAuthorityId":"sdep-ca0363","competentAuthorityName":"Amsterdam (inclusief Weesp)","createdAt":"2025-01-01T00:00:00Z"}]}}}},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"400":{"description":"Bad request - invalid query parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"}}}},"/areas/count":{"get":{"tags":["ca"],"summary":"Get areas count for the currently authenticated competent authority (optional, to support pagination)","description":"Get areas count for the currently authenticated competent authority (optional, to support pagination).","operationId":"countOwnAreas","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AreaCountResponse"}}}},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"}},"security":[{"OAuth2ClientCredentials":[]}]}},"/areas/{areaId}":{"get":{"tags":["ca"],"summary":"Get area (shapefile) for the currently authenticated competent authority","description":"Get area (shapefile) based on functional ID, scoped to the currently authenticated competent authority.","operationId":"getOwnArea","security":[{"OAuth2ClientCredentials":[]}],"parameters":[{"name":"areaId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9-]+$","title":"Areaid"}}],"responses":{"200":{"description":"Successful Response","content":{"application/zip":{}}},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"},"404":{"description":"Resource Not Found - area unavailable, deleted, or not owned by this CA"}}},"delete":{"tags":["ca"],"summary":"Delete (deactivate) an area from the areas collection for the currently authenticated competent authority","description":"Delete (deactivate) an area by marking it as ended (now, UTC).\n\n**Behavior:**\n- Deletes (deactivates) the area\n- The area will no longer appear in area listings\n- Deleting an already-deleted area returns 404","operationId":"deleteOwnArea","security":[{"OAuth2ClientCredentials":[]}],"parameters":[{"name":"areaId","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":64,"pattern":"^[A-Za-z0-9-]+$","title":"Areaid"}}],"responses":{"204":{"description":"Success - area deleted (deactivate)"},"500":{"description":"Internal Server Error - an unexpected issue occurred that prevented the request from being completed"},"503":{"description":"Service Unavailable - temporarily unable to process requests due to overload, maintenance, or dependency issues (database/authorization server)"},"401":{"description":"Unauthorized - missing or invalid token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"403":{"description":"Forbidden - insufficient permissions"},"404":{"description":"Resource Not Found - area unavailable, already deleted, or not owned by this CA"},"422":{"description":"Validation Error - business rule violation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ActivityCountResponse":{"properties":{"count":{"type":"integer","minimum":0.0,"title":"Count","description":"Total number of activity records","examples":[42]}},"type":"object","required":["count"],"title":"Activity.CountResponse","description":"Count of activities response schema."},"ActivityListResponse":{"properties":{"activities":{"items":{"$ref":"#/components/schemas/ActivityResponse"},"type":"array","title":"Activities","description":"List of activities"}},"type":"object","required":["activities"],"title":"Activity.ListResponse","description":"List of activities for GET responses."},"ActivityResponse":{"properties":{"activityId":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$","title":"Activityid","description":"Functional ID identifying this activity","examples":["550e8400-e29b-41d4-a716-446655440000","550E8400-E29B-41D4-A716-446655440000"]},"activityName":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Activityname","description":"Display name (optional) of the activity"},"status":{"$ref":"#/components/schemas/ActivityStatus","description":"Lifecycle status of the activity: `finished` or `cancelled`.","examples":["finished","cancelled"]},"areaId":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$","title":"Areaid","description":"Functional ID referencing the area where this activity took place","examples":["3ab7c2b9-5c8d-4100-bc3e-00ac115f0495","3AB7C2B9-5C8D-4100-BC3E-00AC115F0495"]},"competentAuthorityId":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$","title":"Competentauthorityid","description":"Functional ID referencing the competent authority that owns the area","examples":["sdep-ca0363","SDEP-CA0363"]},"competentAuthorityName":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Competentauthorityname","description":"Display name (optional) of the competent authority"},"url":{"type":"string","title":"Url","description":"URL of the originating listing/advertisement"},"address":{"$ref":"#/components/schemas/CommonAddressResponse","description":"Address composite (`thoroughfare`, `locatorDesignatorNumber` (optional), `locatorDesignatorLetter` (optional), `locatorDesignatorAddition` (optional), `postCode`, `postName`, `fullAddress`)"},"registrationNumber":{"type":"string","title":"Registrationnumber","description":"Registration number of the address"},"numberOfGuests":{"type":"integer","title":"Numberofguests","description":"Number of guests (1-1024)"},"countryOfGuests":{"items":{"type":"string"},"type":"array","title":"Countryofguests","description":"Array of country codes of guests (each element is ISO 3166-1 alpha-3 or 'N/A'); array length equals numberOfGuests."},"temporal":{"$ref":"#/components/schemas/CommonTemporalResponse","description":"Temporal composite (`startDatetime`, `endDatetime`)"},"platformId":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$","title":"Platformid","description":"Functional ID referencing the platform that owns the activity","examples":["str01","STR01"]},"platformName":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Platformname","description":"Display name (optional) of the platform"},"createdAt":{"type":"string","format":"date-time","title":"Createdat","description":"Timestamp when this activity version was created (UTC)"}},"type":"object","required":["activityId","status","areaId","competentAuthorityId","url","address","registrationNumber","numberOfGuests","countryOfGuests","temporal","platformId","createdAt"],"title":"Activity.Response","description":"Activity response schema."},"ActivityStatus":{"type":"string","enum":["finished","cancelled"],"title":"Activity.Status","description":"Lifecycle status for an activity record."},"AreaCountResponse":{"properties":{"count":{"type":"integer","minimum":0.0,"title":"Count","description":"Total number of areas in context of the current SDEP/member state","examples":[42]}},"type":"object","required":["count"],"title":"Area.CountResponse","description":"Count of areas response schema."},"AreaListResponse":{"properties":{"areas":{"items":{"$ref":"#/components/schemas/AreaResponse"},"type":"array","title":"Areas","description":"List of areas in context of the current SDEP/member state"}},"type":"object","required":["areas"],"title":"Area.ListResponse","description":"List of areas response schema."},"Area.Request":{"properties":{"areaId":{"anyOf":[{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$"},{"type":"null"}],"title":"Areaid"},"areaName":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Areaname"},"regulation":{"anyOf":[{"$ref":"#/components/schemas/Regulation"},{"type":"null"}]},"file":{"type":"string","format":"binary","title":"File"}},"type":"object","required":["file"],"title":"Area.Request"},"AreaResponse":{"properties":{"areaId":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$","title":"Areaid","description":"Functional ID identifying this area","examples":["959a7439-7cad-4009-96ec-353b44723db9"]},"areaName":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Areaname","description":"Display name (optional) of the area","examples":["Amsterdam"]},"regulation":{"$ref":"#/components/schemas/Regulation","description":"Regulation type of the area - 'listing', 'activity', or 'all'","default":"all","examples":["all"]},"filename":{"type":"string","maxLength":64,"title":"Filename","description":"Name of the area shapefile (e.g., 'area.zip')","examples":["Amsterdam.zip"]},"competentAuthorityId":{"type":"string","maxLength":64,"minLength":1,"pattern":"^[A-Za-z0-9-]+$","title":"Competentauthorityid","description":"Functional ID of the competent authority that owns the area","examples":["sdep-ca0363"]},"competentAuthorityName":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Competentauthorityname","description":"Display name (optional) of the competent authority","examples":["Amsterdam (inclusief Weesp)"]},"createdAt":{"type":"string","format":"date-time","title":"Createdat","description":"Timestamp when this area version was created (UTC)","examples":["2025-01-01T00:00:00Z"]}},"type":"object","required":["areaId","filename","competentAuthorityId","createdAt"],"title":"Area.Response","description":"Area response schema."},"CommonAddressResponse":{"properties":{"thoroughfare":{"type":"string","title":"Thoroughfare","description":"Street / public space name"},"locatorDesignatorNumber":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Locatordesignatornumber","description":"Numeric house number component (optional)"},"locatorDesignatorLetter":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locatordesignatorletter","description":"Letter/character suffix (optional)"},"locatorDesignatorAddition":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Locatordesignatoraddition","description":"Additional qualifier (optional)"},"postCode":{"type":"string","title":"Postcode","description":"Postal code"},"postName":{"type":"string","title":"Postname","description":"City / town / village"},"fullAddress":{"type":"string","title":"Fulladdress","description":"Full address as a single string"}},"type":"object","required":["thoroughfare","postCode","postName","fullAddress"],"title":"Common.AddressResponse","description":"Address composite schema for activity responses (INSPIRE/STR-AP field names)."},"Regulation":{"type":"string","enum":["listing","activity","all"],"title":"Common.Regulation","description":"Regulation type for an area: 'listing', 'activity', or 'all' (covers both)."},"CommonTemporalResponse":{"properties":{"startDatetime":{"type":"string","format":"date-time","title":"Startdatetime","description":"Start date and time of the rental activity"},"endDatetime":{"type":"string","format":"date-time","title":"Enddatetime","description":"End date and time of the rental activity"}},"type":"object","required":["startDatetime","endDatetime"],"title":"Common.TemporalResponse","description":"Temporal composite schema for activity responses."},"ErrorDetail":{"properties":{"msg":{"type":"string","title":"Msg","description":"Human-readable error message"},"type":{"type":"string","title":"Type","description":"Error type identifier"},"loc":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array"},{"type":"null"}],"title":"Loc","description":"Location of the error (e.g. ['body', 'fieldName'])"}},"type":"object","required":["msg","type"],"title":"Error.Detail","description":"Detail of a single error."},"ErrorResponse":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ErrorDetail"},"type":"array","title":"Detail","description":"List of error details"}},"type":"object","required":["detail"],"title":"Error.Response","description":"Standardized error response format."}},"securitySchemes":{"OAuth2ClientCredentials":{"type":"oauth2","flows":{"clientCredentials":{"scopes":{},"tokenUrl":"https://sdep.gov.nl/api/auth/v1/token"}}}}}}