@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Lexicon Schemas API
@version 1.0.0
@endpoints 8
@toc projects(8)

@endpoint GET /projects/{projectId}/schemas
@desc List Schemas
@returns(200) {results: [map], status: str} # Success
@errors {401, 403}

@endpoint POST /projects/{projectId}/schemas
@desc Create/Replace Multiple
@required {entries: [map{entityType!: str, name!: str, schemaJson!: map}] # The list of schema entries to upload}
@optional {truncate: bool=false # If true, delete your entire data dictionary before inserting these entries. This is primarily useful if you want to upload a single file that represents your entire data dictionary.}
@returns(200) {results: map{added: int, deleted: int}, status: str} # Success
@errors {401, 403}

@endpoint DELETE /projects/{projectId}/schemas
@desc Delete all Schemas
@returns(200) {results: map{delete_count: int}, status: str} # Success
@errors {401, 403}

@endpoint GET /projects/{projectId}/schemas/{entityType}
@desc List for Entity
@returns(200) {results: [map], status: str} # Success
@errors {401, 403}

@endpoint DELETE /projects/{projectId}/schemas/{entityType}
@desc Delete for Entity
@returns(200) {results: map{delete_count: int}, status: str} # Success
@errors {401, 403}

@endpoint GET /projects/{projectId}/schemas/{entityType}/{name}
@desc List for Entity and Name
@returns(200) {description: str, properties: map, metadata: map{com.mixpanel: map{$source: str, displayName: str, tags: [str], hidden: bool, dropped: bool, contacts: [str], teamContacts: [str]}}} # Success
@errors {401, 403}

@endpoint DELETE /projects/{projectId}/schemas/{entityType}/{name}
@desc Delete for Entity and Name
@returns(200) {results: map{delete_count: int}, status: str} # Success
@errors {401, 403}

@endpoint POST /projects/{projectId}/schemas/{entityType}/{name}
@desc Create/Replace One
@optional {description: str # The entity description, properties: map # The list of properties that should be included on an instance of this entity, metadata: map{com.mixpanel: map}}
@returns(200) {status: str} # Success
@errors {400, 401, 403}

@end
