@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api DLx
@base https://api.digitallinguistics.io/v0
@version 0.3.1
@auth ApiKey Authorization in header
@endpoints 18
@toc languages(12), lexemes(6)

@group languages
@endpoint GET /languages
@desc Get all Languages
@optional {continuation: any # The `dlx-continuation` header is used to send a continuation token with the request, when retrieving the next page of results., deleted: any # Setting the `deleted` option to `true` will return results that have been marked for deletion, but not yet deleted from the database. Otherwise requests for a resource marked for deletion will return a 410 error., ifModifiedSince: any # The `If-Modified-Since` header is used to retrieve only results modified since a given time. The value of this header must be a valid date string., maxItemCount: any # The `dlx-max-item-count` header is used to limit the number of results to a certain amount at a time (by default all results will be returned). If there are more results to be returned, a continuation token will also be sent in the `dlx-continuation` header., public: any # Set this parameter to `true` to include all publicly-accessible resources, not just those that the user is listed as an Owner, Contributor, or Viewer for.}
@returns(200) 200: Operation successful.

@endpoint POST /languages
@desc Add a new Language
@required {body: map # A database resource to upsert}
@returns(201) 201: The resource was created successfully.

@endpoint PUT /languages
@desc Upsert (create or replace) a Language
@required {body: map # A database resource to upsert}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(201) 201: Upsert successful.

@endpoint GET /languages/{languageID}
@desc Retrieve a Language by ID
@required {languageID: any # The ID of the Language to perform the operation on}
@optional {deleted: any # Setting the `deleted` option to `true` will return results that have been marked for deletion, but not yet deleted from the database. Otherwise requests for a resource marked for deletion will return a 410 error., ifNoneMatch: any # If `If-None-Match` header is used with GET requests to check whether you already have the most up-to-date version of the resource, and therefore do not need the resource sent again. The value of the `If-None-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to reduce bandwidth.}
@returns(200) 200: Operation successful.
@errors {304: 304: Not modified.}

@endpoint DELETE /languages/{languageID}
@desc Delete a Language by ID
@required {languageID: any # The ID of the Language to perform the operation on}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(204) 204: Delete operation successful.

@endpoint PATCH /languages/{languageID}
@desc Perform a partial update on a Language
@required {languageID: any # The ID of the Language to perform the operation on, body: map # A database resource to upsert}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(200) 200: Update successful.

@endpoint GET /languages/{languageID}/lexemes
@desc Get all Lexemes for a Language
@required {languageID: any # The ID of the Language to perform the operation on}
@optional {continuation: any # The `dlx-continuation` header is used to send a continuation token with the request, when retrieving the next page of results., deleted: any # Setting the `deleted` option to `true` will return results that have been marked for deletion, but not yet deleted from the database. Otherwise requests for a resource marked for deletion will return a 410 error., ifModifiedSince: any # The `If-Modified-Since` header is used to retrieve only results modified since a given time. The value of this header must be a valid date string., maxItemCount: any # The `dlx-max-item-count` header is used to limit the number of results to a certain amount at a time (by default all results will be returned). If there are more results to be returned, a continuation token will also be sent in the `dlx-continuation` header., public: any # Set this parameter to `true` to include all publicly-accessible resources, not just those that the user is listed as an Owner, Contributor, or Viewer for.}
@returns(200) 200: Operation successful.

@endpoint POST /languages/{languageID}/lexemes
@desc Add a new Lexeme to a Language
@required {languageID: any # The ID of the Language to perform the operation on}
@returns(201) 201: The resource was created successfully.

@endpoint PUT /languages/{languageID}/lexemes
@desc Upsert (add or replace) a Lexeme
@required {languageID: any # The ID of the Language to perform the operation on}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(201) 201: Upsert successful.

@endpoint GET /languages/{languageID}/lexemes/{lexemeID}
@desc Get a Lexeme by ID
@required {languageID: any # The ID of the Language to perform the operation on, lexemeID: any # The ID of the Lexeme to perform the operation on}
@optional {deleted: any # Setting the `deleted` option to `true` will return results that have been marked for deletion, but not yet deleted from the database. Otherwise requests for a resource marked for deletion will return a 410 error., ifNoneMatch: any # If `If-None-Match` header is used with GET requests to check whether you already have the most up-to-date version of the resource, and therefore do not need the resource sent again. The value of the `If-None-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to reduce bandwidth.}
@returns(200) 200: Operation successful.
@errors {304: 304: Not modified.}

@endpoint DELETE /languages/{languageID}/lexemes/{lexemeID}
@desc Delete a Lexeme by ID
@required {languageID: any # The ID of the Language to perform the operation on, lexemeID: any # The ID of the Lexeme to perform the operation on}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(204) 204: Delete operation successful.

@endpoint PATCH /languages/{languageID}/lexemes/{lexemeID}
@desc Perform a partial update on a Lexeme
@required {languageID: any # The ID of the Language to perform the operation on, lexemeID: any # The ID of the Lexeme to perform the operation on}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(200) 200: Update successful.

@endgroup

@group lexemes
@endpoint GET /lexemes
@desc Get all Lexemes
@optional {continuation: any # The `dlx-continuation` header is used to send a continuation token with the request, when retrieving the next page of results., deleted: any # Setting the `deleted` option to `true` will return results that have been marked for deletion, but not yet deleted from the database. Otherwise requests for a resource marked for deletion will return a 410 error., ifModifiedSince: any # The `If-Modified-Since` header is used to retrieve only results modified since a given time. The value of this header must be a valid date string., languageID: any # The ID of the Language to perform the operation on, maxItemCount: any # The `dlx-max-item-count` header is used to limit the number of results to a certain amount at a time (by default all results will be returned). If there are more results to be returned, a continuation token will also be sent in the `dlx-continuation` header., public: any # Set this parameter to `true` to include all publicly-accessible resources, not just those that the user is listed as an Owner, Contributor, or Viewer for.}
@returns(200) 200: Operation successful.

@endpoint POST /lexemes
@desc Add a new Lexeme
@optional {languageID: any # The ID of the Language to perform the operation on}
@returns(201) 201: The resource was created successfully.

@endpoint PUT /lexemes
@desc Upsert (add or replace) a Lexeme
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts., languageID: any # The ID of the Language to perform the operation on}
@returns(201) 201: Upsert successful.

@endpoint GET /lexemes/{lexemeID}
@desc Get a Lexeme by ID
@required {lexemeID: any # The ID of the Lexeme to perform the operation on}
@optional {deleted: any # Setting the `deleted` option to `true` will return results that have been marked for deletion, but not yet deleted from the database. Otherwise requests for a resource marked for deletion will return a 410 error., ifNoneMatch: any # If `If-None-Match` header is used with GET requests to check whether you already have the most up-to-date version of the resource, and therefore do not need the resource sent again. The value of the `If-None-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to reduce bandwidth.}
@returns(200) 200: Operation successful.
@errors {304: 304: Not modified.}

@endpoint DELETE /lexemes/{lexemeID}
@desc Delete a Lexeme by ID
@required {lexemeID: any # The ID of the Lexeme to perform the operation on}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(204) 204: Delete operation successful.

@endpoint PATCH /lexemes/{lexemeID}
@desc Perform a partial update on a Lexeme
@required {lexemeID: any # The ID of the Lexeme to perform the operation on}
@optional {ifMatch: any # The `If-Match` header is used with PUT and DELETE requests to check whether you have the most up-to-date version of the resource before updating or deleting it. The value of the `If-Match` header is the ETag (`_etag`) property of the resource. It is recommended that your application use this header whenever possible to avoid data conflicts.}
@returns(200) 200: Update successful.

@endgroup

@end
