@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Pinecone API
@base https://controller.us-east1-gcp.pinecone.io
@version 20230406.1
@auth ApiKey Api-Key in header
@endpoints 15
@toc collections(4), databases(5), describe_index_stats(1), query(1), vectors(4)

@group collections
@endpoint GET /collections
@returns(200)

@endpoint POST /collections
@required {name: str(CollectionName), source: str(IndexName)}
@returns(201)
@errors {400, 409, 500}

@endpoint GET /collections/{collectionName}
@returns(200) {name: str(CollectionName), size: int(int64), status: str(CollectionState)}
@errors {404, 500}

@endpoint DELETE /collections/{collectionName}
@returns(202)
@errors {404, 500}

@endgroup

@group databases
@endpoint GET /databases
@returns(200)

@endpoint POST /databases
@required {name: str(IndexName), dimension: int(int32)}
@optional {metric: str(euclidean/cosine/dotproduct), pods: int(int32)=1, replicas: int(int32)=1, pod_type: str(s1.x1/s1.x2/s1.x4/s1.x8/p1.x1/p1.x2/p1.x4/p1.x8/p2.x1/p2.x2/p2.x4/p2.x8), metadata_config: map{indexed: [str]}, source_collection: str(CollectionName)}
@returns(201)
@errors {400, 409, 500}

@endpoint GET /databases/{indexName}
@returns(200) {database: map{name: str(IndexName), metric: str, dimension: int(int32), replicas: int(int32), shards: int(int32), pods: int(int32), pod_type: str}, status: map{host: str(Hostname), port: int(int32), state: str(IndexState), ready: bool}}
@errors {404, 500}

@endpoint DELETE /databases/{indexName}
@returns(202)
@errors {404, 500}

@endpoint PATCH /databases/{indexName}
@optional {replicas: int(int32)=1, pod_type: str(s1.x1/s1.x2/s1.x4/s1.x8/p1.x1/p1.x2/p1.x4/p1.x8/p2.x1/p2.x2/p2.x4/p2.x8)}
@returns(201)
@errors {400, 404, 500}

@endgroup

@group describe_index_stats
@endpoint POST /describe_index_stats
@optional {filter: map}
@returns(200) {namespaces: map, dimension: int(int32), indexFullness: num(float), totalVectorCount: int(int64)}

@endgroup

@group query
@endpoint POST /query
@required {topK: int(int64)=100}
@optional {namespace: str(NamespaceName), filter: map, includeValues: bool=false, includeMetadata: bool=false, vector: [num(float)], sparseVector: map{indices!: [int(int64)], values!: [num(float)]}, id: str(VectorId)}
@returns(200) {matches: [map], namespace: str(NamespaceName)}

@endgroup

@group vectors
@endpoint POST /vectors/delete
@optional {ids: [str(VectorId)], deleteAll: bool=false, namespace: str(NamespaceName), filter: map}
@returns(200)

@endpoint POST /vectors/fetch
@required {ids: [str(VectorId)]}
@optional {namespace: str(NamespaceName)}
@returns(200) {vectors: map, namespace: str(NamespaceName)}

@endpoint POST /vectors/update
@required {id: str(VectorId)}
@optional {values: [num(float)], sparseValues: map{indices!: [int(int64)], values!: [num(float)]}, setMetadata: map, namespace: str(NamespaceName)}
@returns(200)

@endpoint POST /vectors/upsert
@required {vectors: [map{id: str(VectorId), values: [num(float)], sparseValues: map, metadata: map}]}
@optional {namespace: str(NamespaceName)}
@returns(200) {upsertedCount: int(int64)}

@endgroup

@end
