@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Developer API - Upstash
@base https://api.upstash.com/v2
@version 1.0.0
@auth Bearer basic
@endpoints 58
@hint download_for_search
@toc redis(22), teams(4), auditlogs(1), team(2), vector(10), search(9), qstash(10)

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

@endpoint GET /redis/database/{id}
@required {id: str}
@optional {credentials: str}
@returns(200) {database_id: str, database_name: str, region: str, port: int(int64), creation_time: int(int64), state: str, endpoint: str, tls: bool, db_max_clients: int(int64), db_max_request_size: int(int64), db_disk_threshold: int(int64), db_max_entry_size: int(int64), db_memory_threshold: int(int64), db_max_commands_per_second: int(int64), db_request_limit: int(int64), type: str, budget: int(int64), primary_region: str, primary_members: [str], all_members: [str], eviction: bool, auto_upgrade: bool, consistent: bool, modifying_state: str, db_resource_size: str, db_type: str, db_conn_idle_timeout: int(int64), db_lua_timeout: int(int64), db_lua_credits_per_min: int(int64), db_store_max_idle: int(int64), db_max_loads_per_sec: int(int64), db_acl_enabled: str, db_acl_default_user_status: str, db_eviction: bool, last_plan_upgrade_time: int(int64), replicas: int, customer_id: str, daily_backup_enabled: bool, read_regions: [str], securityAddons: map{ipWhitelisting: bool, vpcPeering: bool, privateLink: bool, tlsMutualAuth: bool, encryptionAtRest: bool}, prometheus_enabled: str, prod_pack_enabled: bool}

@endpoint DELETE /redis/database/{id}
@required {id: str}
@returns(200)

@endpoint POST /redis/database
@required {database_name: str, platform: str(aws/gcp), primary_region: str(us-east-1/us-east-2/us-west-1/us-west-2/ca-central-1/eu-central-1/eu-west-1/eu-west-2/sa-east-1/ap-south-1/ap-northeast-1/ap-southeast-1/ap-southeast-2/af-south-1/us-central1/us-east4/europe-west1/asia-northeast1)}
@optional {read_regions: [str], plan: str(free/payg/fixed_250mb/fixed_1gb/fixed_5gb/fixed_10gb/fixed_50gb/fixed_100gb/fixed_500gb), budget: int, eviction: bool, tls: bool}
@returns(200) {database_id: str, database_name: str, region: str, port: int(int64), creation_time: int(int64), state: str, endpoint: str, tls: bool, db_max_clients: int(int64), db_max_request_size: int(int64), db_disk_threshold: int(int64), db_max_entry_size: int(int64), db_memory_threshold: int(int64), db_max_commands_per_second: int(int64), db_request_limit: int(int64), type: str, budget: int(int64), primary_region: str, primary_members: [str], all_members: [str], eviction: bool, auto_upgrade: bool, consistent: bool, modifying_state: str, db_resource_size: str, db_type: str, db_conn_idle_timeout: int(int64), db_lua_timeout: int(int64), db_lua_credits_per_min: int(int64), db_store_max_idle: int(int64), db_max_loads_per_sec: int(int64), db_acl_enabled: str, db_acl_default_user_status: str, db_eviction: bool, last_plan_upgrade_time: int(int64), replicas: int, customer_id: str, daily_backup_enabled: bool, read_regions: [str], securityAddons: map{ipWhitelisting: bool, vpcPeering: bool, privateLink: bool, tlsMutualAuth: bool, encryptionAtRest: bool}, prometheus_enabled: str, prod_pack_enabled: bool}

@endpoint POST /redis/rename/{id}
@required {id: str, name: str}
@returns(200) {database_id: str, database_name: str, region: str, port: int(int64), creation_time: int(int64), state: str, endpoint: str, tls: bool, db_max_clients: int(int64), db_max_request_size: int(int64), db_disk_threshold: int(int64), db_max_entry_size: int(int64), db_memory_threshold: int(int64), db_max_commands_per_second: int(int64), db_request_limit: int(int64), type: str, budget: int(int64), primary_region: str, primary_members: [str], all_members: [str], eviction: bool, auto_upgrade: bool, consistent: bool, modifying_state: str, db_resource_size: str, db_type: str, db_conn_idle_timeout: int(int64), db_lua_timeout: int(int64), db_lua_credits_per_min: int(int64), db_store_max_idle: int(int64), db_max_loads_per_sec: int(int64), db_acl_enabled: str, db_acl_default_user_status: str, db_eviction: bool, last_plan_upgrade_time: int(int64), replicas: int, customer_id: str, daily_backup_enabled: bool, read_regions: [str], securityAddons: map{ipWhitelisting: bool, vpcPeering: bool, privateLink: bool, tlsMutualAuth: bool, encryptionAtRest: bool}, prometheus_enabled: str, prod_pack_enabled: bool}

@endpoint POST /redis/reset-password/{id}
@required {id: str}
@returns(200) {database_id: str, database_name: str, region: str, port: int(int64), creation_time: int(int64), state: str, endpoint: str, tls: bool, db_max_clients: int(int64), db_max_request_size: int(int64), db_disk_threshold: int(int64), db_max_entry_size: int(int64), db_memory_threshold: int(int64), db_max_commands_per_second: int(int64), db_request_limit: int(int64), type: str, budget: int(int64), primary_region: str, primary_members: [str], all_members: [str], eviction: bool, auto_upgrade: bool, consistent: bool, modifying_state: str, db_resource_size: str, db_type: str, db_conn_idle_timeout: int(int64), db_lua_timeout: int(int64), db_lua_credits_per_min: int(int64), db_store_max_idle: int(int64), db_max_loads_per_sec: int(int64), db_acl_enabled: str, db_acl_default_user_status: str, db_eviction: bool, last_plan_upgrade_time: int(int64), replicas: int, customer_id: str, daily_backup_enabled: bool, read_regions: [str], securityAddons: map{ipWhitelisting: bool, vpcPeering: bool, privateLink: bool, tlsMutualAuth: bool, encryptionAtRest: bool}, prometheus_enabled: str, prod_pack_enabled: bool}

@endpoint POST /redis/enable-tls/{id}
@required {id: str}
@returns(200) {database_id: str, database_name: str, region: str, port: int(int64), creation_time: int(int64), state: str, endpoint: str, tls: bool, db_max_clients: int(int64), db_max_request_size: int(int64), db_disk_threshold: int(int64), db_max_entry_size: int(int64), db_memory_threshold: int(int64), db_max_commands_per_second: int(int64), db_request_limit: int(int64), type: str, budget: int(int64), primary_region: str, primary_members: [str], all_members: [str], eviction: bool, auto_upgrade: bool, consistent: bool, modifying_state: str, db_resource_size: str, db_type: str, db_conn_idle_timeout: int(int64), db_lua_timeout: int(int64), db_lua_credits_per_min: int(int64), db_store_max_idle: int(int64), db_max_loads_per_sec: int(int64), db_acl_enabled: str, db_acl_default_user_status: str, db_eviction: bool, last_plan_upgrade_time: int(int64), replicas: int, customer_id: str, daily_backup_enabled: bool, read_regions: [str], securityAddons: map{ipWhitelisting: bool, vpcPeering: bool, privateLink: bool, tlsMutualAuth: bool, encryptionAtRest: bool}, prometheus_enabled: str, prod_pack_enabled: bool}

@endpoint POST /redis/enable-eviction/{id}
@required {id: str}
@returns(200)

@endpoint POST /redis/disable-eviction/{id}
@required {id: str}
@returns(200)

@endpoint POST /redis/enable-autoupgrade/{id}
@required {id: str}
@returns(200)

@endpoint POST /redis/disable-autoupgrade/{id}
@required {id: str}
@returns(200)

@endpoint POST /redis/change-plan/{id}
@required {id: str, plan_name: str(free/payg/fixed_250mb/fixed_1gb/fixed_5gb/fixed_10gb/fixed_50gb/fixed_100gb/fixed_500gb)}
@optional {database_id: str, auto_upgrade: bool, prod_pack_enabled: bool}
@returns(200)

@endpoint PATCH /redis/update-budget/{id}
@required {id: str, budget: int}
@returns(200)

@endpoint POST /redis/update-regions/{id}
@required {id: str, read_regions: [str]}
@returns(200)

@endpoint POST /redis/move-to-team
@required {team_id: str, database_id: str}
@returns(200)

@endpoint GET /redis/stats/{id}
@required {id: str}
@returns(200) {monitor_count: map{x: str, y: num}, daily_net_commands: int, daily_read_requests: int, daily_write_requests: int, connection_count: [map], keyspace: [map], throughput: [map], diskusage: [map], latencymean: [map], latency_99: [map], read_latency_mean: [map], read_latency_99: [map], write_latency_mean: [map], write_latency_99: [map], hits: [map], misses: [map], read: [map], write: [map], dailyrequests: [map], days: [str], dailybilling: [map], dailybandwidth: int, bandwidths: [map], total_monthly_bandwidth: int, total_monthly_requests: int, total_monthly_read_requests: int, total_monthly_write_requests: int, total_monthly_script_requests: int, queue_optimized: bool, total_monthly_storage: int, current_storage: int, total_monthly_billing: num(float), command_counts: [map]}

@endpoint GET /redis/list-backup/{id}
@required {id: str}
@returns(200)

@endpoint POST /redis/create-backup/{id}
@required {id: str, name: str}
@returns(200)

@endpoint DELETE /redis/delete-backup/{id}/{backup_id}
@required {id: str, backup_id: str}
@returns(200)

@endpoint POST /redis/restore-backup/{id}
@required {id: str, backup_id: str}
@returns(200)

@endpoint PATCH /redis/enable-dailybackup/{id}
@required {id: str}
@returns(200)

@endpoint PATCH /redis/disable-dailybackup/{id}
@required {id: str}
@returns(200)

@endgroup

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

@endgroup

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

@endgroup

@group team
@endpoint POST /team
@required {team_name: str, copy_cc: bool}
@returns(200) {team_id: str, team_name: str, copy_cc: bool}

@endpoint DELETE /team/{id}
@required {id: str}
@returns(200)

@endgroup

@group teams
@endpoint GET /teams/{team_id}
@required {team_id: str}
@returns(200)

@endpoint POST /teams/member
@required {team_id: str, member_email: str, member_role: str(admin/dev/finance)}
@returns(200) {team_id: str, team_name: str, member_email: str, member_role: str, copy_cc: bool}

@endpoint DELETE /teams/member
@required {team_id: str, member_email: str}
@returns(200)

@endgroup

@group vector
@endpoint GET /vector/index
@returns(200)

@endpoint POST /vector/index
@required {name: str, region: str(eu-west-1/us-east-1/us-central1), similarity_function: str(COSINE/EUCLIDEAN/DOT_PRODUCT), dimension_count: num}
@optional {type: str(payg/fixed/paid), embedding_model: str(BGE_SMALL_EN_V1_5/BGE_BASE_EN_V1_5/BGE_LARGE_EN_V1_5/BGE_M3), index_type: str(DENSE/SPARSE/HYBRID), sparse_embedding_model: str(BM25/BGE_M3)}
@returns(200) {customer_id: str, id: str, name: str, similarity_function: str, dimension_count: num, embedding_model: str, sparse_embedding_model: str, endpoint: str, token: str, read_only_token: str, type: str, region: str, max_vector_count: num, max_daily_updates: num, max_daily_queries: num, max_monthly_bandwidth: num, max_writes_per_second: num, max_query_per_second: num, max_reads_per_request: num, max_writes_per_request: num, max_total_metadata_size: num, reserved_price: num, creation_time: num, index_type: str, throughput_vector: [map]}

@endpoint GET /vector/index/{id}
@required {id: str}
@returns(200) {customer_id: str, id: str, name: str, similarity_function: str, dimension_count: num, embedding_model: str, sparse_embedding_model: str, endpoint: str, token: str, read_only_token: str, type: str, region: str, max_vector_count: num, max_daily_updates: num, max_daily_queries: num, max_monthly_bandwidth: num, max_writes_per_second: num, max_query_per_second: num, max_reads_per_request: num, max_writes_per_request: num, max_total_metadata_size: num, reserved_price: num, creation_time: num, index_type: str, throughput_vector: [map]}

@endpoint DELETE /vector/index/{id}
@required {id: str}
@returns(200)

@endpoint POST /vector/index/{id}/rename
@required {id: str, name: str}
@returns(200)

@endpoint POST /vector/index/{id}/reset-password
@required {id: str}
@returns(200)

@endpoint POST /vector/index/{id}/setplan
@required {id: str, target_plan: str(free/payg/fixed)}
@returns(200)

@endpoint POST /vector/index/{id}/transfer
@required {id: str, target_account: str}
@returns(200)

@endpoint GET /vector/index/stats
@returns(200) {record_count: int, request: int, bandwidth: int, storage: int, billing: num(float), rerank_count: int}

@endpoint GET /vector/index/{id}/stats
@required {id: str}
@optional {period: str(1h/3h/12h/1d/3d/7d/30d)=1h}
@returns(200) {pending_index_count: int, current_vector_count: int, daily_query_count: int, daily_update_count: int, monthly_query_count: int, monthly_update_count: int, monthly_bandwidth_usage: int, storage_usage: int, monthly_cost: num(float), daily_update_requests: [map], daily_query_requests: [map], daily_bandwidths: [map], days: [str], query_throughput: [map], update_throughput: [map], query_latency_mean: [map], query_latency_99: [map], update_latency_mean: [map], update_latency_99: [map], embeds_latency_mean: [map], embeds_latency_99: [map], vector_count: [map], data_size: [map], daily_rerank_count: int, monthly_rerank_count: int, daily_rerank_requests: [map], rerank_latency_mean: [map], rerank_latency_99: [map]}

@endgroup

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

@endpoint POST /search
@required {name: str, region: str(eu-west-1/us-central1), type: str(free/payg/fixed)}
@returns(200) {customer_id: str, id: str(uuid), name: str, endpoint: str, type: str, region: str, vercel_email: str, token: str, read_only_token: str, max_vector_count: int, max_monthly_reranks: int, max_daily_updates: int, max_daily_queries: int, max_monthly_bandwidth: int, max_writes_per_second: int, max_query_per_second: int, max_reads_per_request: int, max_writes_per_request: int, creation_time: int(int64), input_enrichment_enabled: bool, throughput_vector: [map]}

@endpoint GET /search/{id}
@required {id: str}
@returns(200) {customer_id: str, id: str(uuid), name: str, endpoint: str, type: str, region: str, vercel_email: str, token: str, read_only_token: str, max_vector_count: int, max_monthly_reranks: int, max_daily_updates: int, max_daily_queries: int, max_monthly_bandwidth: int, max_writes_per_second: int, max_query_per_second: int, max_reads_per_request: int, max_writes_per_request: int, creation_time: int(int64), input_enrichment_enabled: bool, throughput_vector: [map]}

@endpoint DELETE /search/{id}
@required {id: str}
@returns(200)

@endpoint GET /search/stats
@returns(200) {record_count: int, request: int, bandwidth: int, storage: int, billing: num(float), rerank_count: int}

@endpoint GET /search/{id}/stats
@required {id: str}
@optional {period: str(1h/3h/12h/1d/3d/7d/30d)=1h}
@returns(200) {pending_index_count: int, current_vector_count: int, daily_query_count: int, daily_update_count: int, monthly_query_count: int, monthly_update_count: int, monthly_bandwidth_usage: int, storage_usage: int, monthly_cost: num(float), daily_update_requests: [map], daily_query_requests: [map], daily_bandwidths: [map], days: [str], query_throughput: [map], update_throughput: [map], query_latency_mean: [map], query_latency_99: [map], update_latency_mean: [map], update_latency_99: [map], embeds_latency_mean: [map], embeds_latency_99: [map], vector_count: [map], data_size: [map], daily_rerank_count: int, monthly_rerank_count: int, daily_rerank_requests: [map], rerank_latency_mean: [map], rerank_latency_99: [map]}

@endpoint POST /search/{id}/reset-password
@required {id: str}
@returns(200)

@endpoint POST /search/{id}/transfer
@required {id: str, target_account: str}
@returns(200)

@endpoint POST /search/{id}/rename
@required {id: str, name: str}
@returns(200)

@endgroup

@group qstash
@endpoint GET /qstash/users
@returns(200)

@endpoint GET /qstash/user/{id}
@required {id: str}
@returns(200) {customer_id: str, id: str(uuid), password: str, token: str, active: bool, state: str, modifying_state: str, last_plan_upgrade_time: int(int64), max_message_size: int, max_requests_per_day: int, max_requests_per_day_hard: int, max_endpoints_per_topic: int, max_requests_per_second: int, max_dlq_size: int, max_completion_tokens_per_day: int, max_completion_tokens_per_minute: int, max_completions_per_day: int, max_completions_per_minute: int, max_retries: int, max_topics: int, max_schedules: int, max_events_size: int, max_dlq_retention_time_milis: int(int64), max_delay: int, max_parallelism: int, max_global_parallelism: int, max_queues: int, retention: int, timeout: int, rate_limit: int, type: str, reserved_type: str, reserved_price: num(float), prod_pack_enabled: bool, prometheus_enabled: str, enterprise: map{enabled: bool}, region: str, budget: int, created_by: str, creation_time: int(int64)}

@endpoint POST /qstash/rotate-token/{id}
@required {id: str}
@returns(200) {customer_id: str, id: str(uuid), password: str, token: str, active: bool, state: str, modifying_state: str, last_plan_upgrade_time: int(int64), max_message_size: int, max_requests_per_day: int, max_requests_per_day_hard: int, max_endpoints_per_topic: int, max_requests_per_second: int, max_dlq_size: int, max_completion_tokens_per_day: int, max_completion_tokens_per_minute: int, max_completions_per_day: int, max_completions_per_minute: int, max_retries: int, max_topics: int, max_schedules: int, max_events_size: int, max_dlq_retention_time_milis: int(int64), max_delay: int, max_parallelism: int, max_global_parallelism: int, max_queues: int, retention: int, timeout: int, rate_limit: int, type: str, reserved_type: str, reserved_price: num(float), prod_pack_enabled: bool, prometheus_enabled: str, enterprise: map{enabled: bool}, region: str, budget: int, created_by: str, creation_time: int(int64)}

@endpoint POST /qstash/set-plan/{id}
@required {id: str, plan_name: str(paid/qstash_fixed_1m/qstash_fixed_10m/qstash_fixed_100m)}
@returns(200)

@endpoint GET /qstash/stats/{id}
@required {id: str}
@optional {period: str(1h/3h/12h/1d/3d/7d/30d)=1h}
@returns(200) {days: [str], daily_requests: [map], daily_billings: [map], daily_bandwidths: [map], daily_used: [map], daily_used_workflow: [map], daily_qstash_messages: [map], daily_workflow_messages: [map], dlq_message_count: int, daily_bandwidth_used: [map], total_monthly_billing: num(float)}

@endpoint GET /qstash/ipv4
@returns(200)

@endpoint POST /qstash/move-to-team
@required {qstash_id: str, target_team_id: str}
@returns(200)

@endpoint PATCH /qstash/update-budget/{id}
@required {id: str, budget: int}
@returns(200)

@endpoint POST /qstash/enable-prodpack/{id}
@required {id: str}
@returns(200)

@endpoint POST /qstash/disable-prodpack/{id}
@required {id: str}
@returns(200)

@endgroup

@end
