{"openapi":"3.1.0","info":{"title":"crates.io","description":"\n__Experimental API documentation for the [crates.io](https://crates.io/)\npackage registry.__\n\nThis document describes the API used by the crates.io website, cargo\nclient, and other third-party tools to interact with the crates.io\nregistry.\n\nBefore using this API, please read the\n[crates.io data access policy](https://crates.io/data-access) and ensure\nthat your use of the API complies with the policy.\n\n__The API is under active development and may change at any time__,\nthough we will try to avoid breaking changes where possible.\n\nSome parts of the API follow the \"Registry Web API\" spec documented\nat <https://doc.rust-lang.org/cargo/reference/registry-web-api.html>\nand can be considered stable.\n\nMost parts of the API do not require authentication. The endpoints\nthat do require authentication are marked as such in the documentation,\nwith some requiring cookie authentication (usable only by the web UI)\nand others requiring API token authentication (usable by cargo and\nother clients).\n","termsOfService":"https://crates.io/policies","contact":{"name":"the crates.io team","email":"help@crates.io"},"license":{"name":"MIT OR Apache-2.0","url":"https://github.com/rust-lang/crates.io/blob/main/README.md#%EF%B8%8F-license"},"version":"0.0.0"},"servers":[{"url":"https://crates.io"},{"url":"https://staging.crates.io"}],"paths":{"/api/v1/categories":{"get":{"tags":["categories"],"summary":"List all categories.","operationId":"list_categories","parameters":[{"name":"sort","in":"query","description":"The sort order of the categories.\n\nValid values: `alpha`, and `crates`.\n\nDefaults to `alpha`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when listing categories.","required":["categories","meta"],"properties":{"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"The list of categories."},"meta":{"type":"object","description":"Pagination metadata for a category list response.","required":["total"],"properties":{"total":{"type":"integer","format":"int64","description":"The total number of categories.","example":123}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/categories/{category}":{"get":{"tags":["categories"],"summary":"Get category metadata.","operationId":"find_category","parameters":[{"name":"category","in":"path","description":"Name of the category","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting category metadata.","required":["category"],"properties":{"category":{"$ref":"#/components/schemas/Category"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/category_slugs":{"get":{"tags":["categories"],"summary":"List all available category slugs.","operationId":"list_category_slugs","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["category_slugs"],"properties":{"category_slugs":{"type":"array","items":{"$ref":"#/components/schemas/Slug"},"description":"The list of category slugs."}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/confirm/{email_token}":{"put":{"tags":["users"],"summary":"Marks the email belonging to the given token as verified.","operationId":"confirm_user_email","parameters":[{"name":"email_token","in":"path","description":"Secret verification token sent to the user's email address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates":{"get":{"tags":["crates"],"summary":"Returns a list of crates.","description":"Called in a variety of scenarios in the front end, including:\n- Alphabetical listing of crates\n- List of crates under a specific owner\n- Listing a user's followed crates\n\nWhen sorting by relevance, only the first 1000 results can be accessed, even\nthough `meta.total` may report a higher number of matching crates.","operationId":"list_crates","parameters":[{"name":"sort","in":"query","description":"The sort order of the crates.\n\nValid values: `alphabetical`, `relevance`, `downloads`,\n`recent-downloads`, `recent-updates`, `new`.\n\nDefaults to `relevance` if `q` is set, otherwise `alphabetical`.","required":false,"schema":{"type":"string"}},{"name":"q","in":"query","description":"A search query string.","required":false,"schema":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}},{"name":"include_yanked","in":"query","description":"Set to `yes` to include yanked crates.","required":false,"schema":{"type":"string"},"example":"yes"},{"name":"category","in":"query","description":"If set, only return crates that belong to this category, or one\nof its subcategories.","required":false,"schema":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}},{"name":"all_keywords","in":"query","description":"If set, only return crates matching all the given keywords.\n\nThis parameter expects a space-separated list of keywords.","required":false,"schema":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}},{"name":"keyword","in":"query","description":"If set, only return crates matching the given keyword\n(ignored if `all_keywords` is set).","required":false,"schema":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}},{"name":"letter","in":"query","description":"If set, only return crates with names that start with the given letter\n(ignored if `all_keywords` or `keyword` are set).","required":false,"schema":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}},{"name":"user_id","in":"query","description":"If set, only crates owned by the given crates.io user ID are returned\n(ignored if `all_keywords`, `keyword`, or `letter` are set).","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"team_id","in":"query","description":"If set, only crates owned by the given crates.io team ID are returned\n(ignored if `all_keywords`, `keyword`, `letter`, or `user_id` are set).","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"following","in":"query","description":"If set, only crates owned by users the current user follows are returned\n(ignored if `all_keywords`, `keyword`, `letter`, `user_id`,\nor `team_id` are set).\n\nThe exact value of this parameter is ignored, but it must not be empty.","required":false,"schema":{"type":"string"},"example":"yes"},{"name":"ids[]","in":"query","description":"If set, only crates with the specified names are returned (ignored\nif `all_keywords`, `keyword`, `letter`, `user_id`, `team_id`,\nor `following` are set).","required":false,"schema":{"type":"array","items":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when listing crates.","required":["crates","meta"],"properties":{"crates":{"type":"array","items":{"$ref":"#/components/schemas/Crate"}},"meta":{"type":"object","description":"Pagination metadata for a crate list response.","required":["total","next_page","prev_page"],"properties":{"next_page":{"type":["string","null"],"description":"Query string to the next page of results, if any.","example":"?page=3"},"prev_page":{"type":["string","null"],"description":"Query string to the previous page of results, if any.","example":"?page=1"},"total":{"type":"integer","format":"int64","description":"The total number of crates that match the query.","example":123}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{},{"api_token":[]},{"cookie":[]}]}},"/api/v1/crates/new":{"get":{"tags":["crates"],"summary":"Gets crate metadata (for the `new` crate).","description":"This endpoint works around a small limitation in `axum` and is delegating\nto the `GET /api/v1/crates/{name}` endpoint internally.","operationId":"find_new_crate","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting crate metadata.","required":["crate","versions","keywords","categories"],"properties":{"categories":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Category"},"description":"The categories of the crate.","example":null},"crate":{"$ref":"#/components/schemas/Crate","description":"The crate metadata."},"keywords":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Keyword"},"description":"The keywords of the crate.","example":null},"versions":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Version"},"description":"The versions of the crate.","example":null}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"put":{"tags":["publish"],"summary":"Publishes a new crate/version.","description":"Used by `cargo publish` to publish a new crate or to publish a new version of an\nexisting crate.","operationId":"publish","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["crate","warnings"],"properties":{"crate":{"$ref":"#/components/schemas/Crate"},"warnings":{"$ref":"#/components/schemas/PublishWarnings"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"trustpub_token":[]},{"cookie":[]}]}},"/api/v1/crates/{name}":{"get":{"tags":["crates"],"summary":"Gets crate metadata.","operationId":"find_crate","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","description":"Additional data to include in the response.\n\nValid values: `versions`, `keywords`, `categories`, `badges`,\n`downloads`, `default_version`, or `full`.\n\nDefaults to `full` for backwards compatibility.\n\n**Note**: `versions` and `default_version` share the same key `versions`, therefore `default_version` will be ignored if both are provided.\n\nThis parameter expects a comma-separated list of values.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting crate metadata.","required":["crate","versions","keywords","categories"],"properties":{"categories":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Category"},"description":"The categories of the crate.","example":null},"crate":{"$ref":"#/components/schemas/Crate","description":"The crate metadata."},"keywords":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Keyword"},"description":"The keywords of the crate.","example":null},"versions":{"type":["array","null"],"items":{"$ref":"#/components/schemas/Version"},"description":"The versions of the crate.","example":null}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"patch":{"tags":["crates"],"summary":"Updates crate settings.","operationId":"update_crate","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["crate"],"properties":{"crate":{"oneOf":[{"type":"object","properties":{"trustpub_only":{"type":["boolean","null"],"description":"Whether this crate can only be published via Trusted Publishing."}}}],"description":"The crate settings to update."}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["crate"],"properties":{"crate":{"$ref":"#/components/schemas/Crate","description":"The updated crate metadata."}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/crates/{name}/downloads":{"get":{"tags":["crates"],"summary":"Get the download counts for a crate.","description":"This includes the per-day downloads for the last 90 days and for the\nlatest 5 versions plus the sum of the rest.","operationId":"get_crate_downloads","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","description":"Additional data to include in the response.\n\nValid values: `versions`.\n\nDefaults to no additional data.\n\nThis parameter expects a comma-separated list of values.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["version_downloads","meta"],"properties":{"meta":{"type":"object","required":["extra_downloads"],"properties":{"extra_downloads":{"type":"array","items":{"type":"object","required":["date","downloads"],"properties":{"date":{"type":"string","description":"The date this download count is for.","example":"2019-12-13"},"downloads":{"type":"integer","format":"int64","description":"The number of downloads on the given date.","example":123}}}}}},"version_downloads":{"type":"array","items":{"$ref":"#/components/schemas/VersionDownload"},"description":"The per-day download counts for the last 90 days."},"versions":{"type":"array","items":{"$ref":"#/components/schemas/Version"},"description":"The versions referenced in the download counts, if `?include=versions`\nwas requested."}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/follow":{"put":{"tags":["crates"],"summary":"Follow a crate.","operationId":"follow_crate","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]},"delete":{"tags":["crates"],"summary":"Unfollow a crate.","operationId":"unfollow_crate","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/crates/{name}/owner_team":{"get":{"tags":["owners"],"summary":"Lists team owners of a crate.","operationId":"get_team_owners","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["teams"],"properties":{"teams":{"type":"array","items":{"$ref":"#/components/schemas/Owner"}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/owner_user":{"get":{"tags":["owners"],"summary":"Lists user owners of a crate.","operationId":"get_user_owners","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["users"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/Owner"}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/owners":{"get":{"tags":["owners"],"summary":"Lists crate owners.","operationId":"list_owners","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["users"],"properties":{"users":{"type":"array","items":{"$ref":"#/components/schemas/Owner"}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"put":{"tags":["owners"],"summary":"Adds crate owners.","operationId":"add_owners","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["owners"],"properties":{"owners":{"type":"array","items":{"type":"string"},"description":"List of owner login names to add or remove.\n\nFor users, use just the username (e.g., `\"octocat\"`).\nFor GitHub teams, use the format `github:org:team` (e.g., `\"github:rust-lang:owners\"`).","example":["octocat","github:rust-lang:owners"]}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["msg","ok"],"properties":{"msg":{"type":"string","description":"A message describing the result of the operation.","example":"user ghost has been invited to be an owner of crate serde"},"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]},"delete":{"tags":["owners"],"summary":"Removes crate owners.","operationId":"remove_owners","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["owners"],"properties":{"owners":{"type":"array","items":{"type":"string"},"description":"List of owner login names to add or remove.\n\nFor users, use just the username (e.g., `\"octocat\"`).\nFor GitHub teams, use the format `github:org:team` (e.g., `\"github:rust-lang:owners\"`).","example":["octocat","github:rust-lang:owners"]}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["msg","ok"],"properties":{"msg":{"type":"string","description":"A message describing the result of the operation.","example":"user ghost has been invited to be an owner of crate serde"},"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/crates/{name}/reverse_dependencies":{"get":{"tags":["crates"],"summary":"Lists reverse dependencies of a crate.","operationId":"list_reverse_dependencies","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["dependencies","versions","meta"],"properties":{"dependencies":{"type":"array","items":{"$ref":"#/components/schemas/Dependency"},"description":"The list of reverse dependencies of the crate."},"meta":{"type":"object","required":["total"],"properties":{"total":{"type":"integer","format":"int64","example":32}}},"versions":{"type":"array","items":{"$ref":"#/components/schemas/Version"},"description":"The versions referenced in the `dependencies` field."}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/versions":{"get":{"tags":["versions"],"summary":"List all versions of a crate.","operationId":"list_versions","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","description":"Additional data to include in the response.\n\nValid values: `release_tracks`.\n\nDefaults to no additional data.\n\nThis parameter expects a comma-separated list of values.","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","description":"The sort order of the versions.\n\nValid values: `date`, and `semver`.\n\nDefaults to `semver`.","required":false,"schema":{"type":"string"}},{"name":"nums[]","in":"query","description":"If set, only versions with the specified semver strings are returned.","required":false,"schema":{"type":"array","items":{"type":"string","description":"A string that does not contain null bytes (`\\0`)."}}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when listing versions of a crate.","required":["versions","meta"],"properties":{"meta":{"type":"object","required":["total","next_page"],"properties":{"next_page":{"type":["string","null"],"description":"Query string to the next page of results, if any.","example":"?page=3"},"release_tracks":{"type":"object","description":"Additional data about the crate's release tracks,\nif `?include=release_tracks` is used.","additionalProperties":{"$ref":"#/components/schemas/ReleaseTrackDetails"},"propertyNames":{"type":"string"}},"total":{"type":"integer","format":"int64","description":"The total number of versions belonging to the crate.","example":123}}},"versions":{"type":"array","items":{"$ref":"#/components/schemas/Version"}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/{version}":{"get":{"tags":["versions"],"summary":"Get crate version metadata.","operationId":"find_version","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting crate version metadata.","required":["version"],"properties":{"version":{"$ref":"#/components/schemas/Version"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"patch":{"tags":["versions"],"summary":"Update a crate version.","description":"This endpoint allows updating the `yanked` state of a version, including a yank message.","operationId":"update_version","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["version"],"properties":{"version":{"$ref":"#/components/schemas/VersionUpdate"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["version"],"properties":{"version":{"$ref":"#/components/schemas/Version"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/crates/{name}/{version}/authors":{"get":{"tags":["versions"],"summary":"Get crate version authors.","description":"This endpoint was deprecated by [RFC #3052](https://github.com/rust-lang/rfcs/pull/3052)\nand returns an empty list for backwards compatibility reasons.","operationId":"get_version_authors","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response"},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"deprecated":true}},"/api/v1/crates/{name}/{version}/dependencies":{"get":{"tags":["versions"],"summary":"Get crate version dependencies.","description":"This information can also be obtained directly from the index.\n\nIn addition to returning cached data from the index, this returns\nfields for `id`, `version_id`, and `downloads` (which appears to always\nbe 0)","operationId":"get_version_dependencies","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["dependencies"],"properties":{"dependencies":{"type":"array","items":{"$ref":"#/components/schemas/Dependency"}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/{version}/download":{"get":{"tags":["versions"],"summary":"Download a crate version.","description":"This returns a URL to the location where the crate is stored.","operationId":"download_version","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response (for `content-type: application/json`)","content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"The URL to the crate file.","example":"https://static.crates.io/crates/serde/serde-1.0.0.crate"}}}}}},"302":{"description":"Successful Response (default)","headers":{"location":{"schema":{"type":"string"},"description":"The URL to the crate file."}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/{version}/downloads":{"get":{"tags":["versions"],"summary":"Get the download counts for a crate version.","description":"This includes the per-day downloads for the last 90 days.","operationId":"get_version_downloads","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"},{"name":"before_date","in":"query","description":"Only return download counts before this date.","required":false,"schema":{"type":"string","format":"date"},"example":"2024-06-28"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["version_downloads"],"properties":{"version_downloads":{"type":"array","items":{"$ref":"#/components/schemas/VersionDownload"}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/{version}/readme":{"get":{"tags":["versions"],"summary":"Get the readme of a crate version.","operationId":"get_version_readme","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response (for `content-type: application/json`)","content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"url":{"type":"string","description":"The URL to the readme file.","example":"https://static.crates.io/readmes/serde/serde-1.0.0.html"}}}}}},"302":{"description":"Successful Response (default)","headers":{"location":{"schema":{"type":"string"},"description":"The URL to the readme file."}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/crates/{name}/{version}/unyank":{"put":{"tags":["versions"],"summary":"Unyank a crate version.","operationId":"unyank_version","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/crates/{name}/{version}/yank":{"delete":{"tags":["versions"],"summary":"Yank a crate version.","description":"This does not delete a crate version, it makes the crate\nversion accessible only to crates that already have a\n`Cargo.lock` containing this version.\n\nNotes:\n\nVersion deletion is not implemented to avoid breaking builds,\nand the goal of yanking a crate is to prevent crates\nbeginning to depend on the yanked crate version.","operationId":"yank_version","parameters":[{"name":"name","in":"path","description":"Name of the crate","required":true,"schema":{"type":"string"}},{"name":"version","in":"path","description":"Version number","required":true,"schema":{"type":"string"},"example":"1.0.0"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/keywords":{"get":{"tags":["keywords"],"summary":"List all keywords.","operationId":"list_keywords","parameters":[{"name":"sort","in":"query","description":"The sort order of the keywords.\n\nValid values: `alpha`, and `crates`.\n\nDefaults to `alpha`.","required":false,"schema":{"type":"string"}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when listing keywords.","required":["keywords","meta"],"properties":{"keywords":{"type":"array","items":{"$ref":"#/components/schemas/Keyword"},"description":"The list of keywords."},"meta":{"type":"object","description":"Pagination metadata for a keyword list response.","required":["total"],"properties":{"total":{"type":"integer","format":"int64","description":"The total number of keywords.","example":123}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/keywords/{keyword}":{"get":{"tags":["keywords"],"summary":"Get keyword metadata.","operationId":"find_keyword","parameters":[{"name":"keyword","in":"path","description":"The keyword to find","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting keyword metadata.","required":["keyword"],"properties":{"keyword":{"$ref":"#/components/schemas/Keyword"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/me/crate_owner_invitations/accept/{token}":{"put":{"tags":["owners"],"summary":"Accept a crate owner invitation with a token.","operationId":"accept_crate_owner_invitation_with_token","parameters":[{"name":"token","in":"path","description":"Secret token sent to the user's email address","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["crate_owner_invitation"],"properties":{"crate_owner_invitation":{"type":"object","required":["crate_id","accepted"],"properties":{"accepted":{"type":"boolean","description":"Whether the invitation was accepted.","example":true},"crate_id":{"type":"integer","format":"int32","description":"The opaque identifier for the crate this invitation is for.","example":42}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/me/crate_owner_invitations/{crate_id}":{"put":{"tags":["owners"],"summary":"Accept or decline a crate owner invitation.","operationId":"handle_crate_owner_invitation","parameters":[{"name":"crate_id","in":"path","description":"ID of the crate","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["crate_owner_invite"],"properties":{"crate_owner_invite":{"type":"object","required":["crate_id","accepted"],"properties":{"accepted":{"type":"boolean","description":"Whether the invitation was accepted.","example":true},"crate_id":{"type":"integer","format":"int32","description":"The opaque identifier for the crate this invitation is for.","example":42}}}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["crate_owner_invitation"],"properties":{"crate_owner_invitation":{"type":"object","required":["crate_id","accepted"],"properties":{"accepted":{"type":"boolean","description":"Whether the invitation was accepted.","example":true},"crate_id":{"type":"integer","format":"int32","description":"The opaque identifier for the crate this invitation is for.","example":42}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/me/email_notifications":{"put":{"tags":["users"],"summary":"Update email notification settings for the authenticated user.","description":"This endpoint was implemented for an experimental feature that was never\nfully implemented. It is now deprecated and will be removed in the future.","operationId":"update_email_notifications","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"deprecated":true,"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/me/tokens/{id}":{"get":{"tags":["api_tokens"],"summary":"Find API token by id.","operationId":"find_api_token","parameters":[{"name":"id","in":"path","description":"ID of the API token","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting an API token by ID.","required":["api_token"],"properties":{"api_token":{"$ref":"#/components/schemas/ApiToken"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]},"delete":{"tags":["api_tokens"],"summary":"Revoke API token.","operationId":"revoke_api_token","parameters":[{"name":"id","in":"path","description":"ID of the API token","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object"}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/site_metadata":{"get":{"tags":["other"],"summary":"Get crates.io metadata.","description":"Returns the current deployed commit SHA1 (or `unknown`), and whether the\nsystem is in read-only mode.","operationId":"get_site_metadata","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["deployed_sha","commit","cdn_base","read_only"],"properties":{"banner_message":{"type":"string","description":"Optional banner message to display on all pages."},"cdn_base":{"type":"string","description":"CDN base URL that e.g. crate files are served from.","example":"https://static.crates.io"},"commit":{"type":"string","description":"The SHA1 of the currently deployed commit.","example":"0aebe2cdfacae1229b93853b1c58f9352195f081"},"deployed_sha":{"type":"string","description":"The SHA1 of the currently deployed commit.","example":"0aebe2cdfacae1229b93853b1c58f9352195f081"},"read_only":{"type":"boolean","description":"Whether the crates.io service is in read-only mode."}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/summary":{"get":{"tags":["other"],"summary":"Get front page data.","description":"This endpoint returns a summary of the most important data for the front\npage of crates.io.","operationId":"get_summary","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["num_downloads","num_crates","new_crates","most_downloaded","most_recently_downloaded","just_updated","popular_keywords","popular_categories"],"properties":{"just_updated":{"type":"array","items":{"$ref":"#/components/schemas/Crate"},"description":"The 10 most recently updated crates."},"most_downloaded":{"type":"array","items":{"$ref":"#/components/schemas/Crate"},"description":"The 10 crates with the highest total number of downloads."},"most_recently_downloaded":{"type":"array","items":{"$ref":"#/components/schemas/Crate"},"description":"The 10 crates with the highest number of downloads within the last 90 days."},"new_crates":{"type":"array","items":{"$ref":"#/components/schemas/Crate"},"description":"The 10 most recently created crates."},"num_crates":{"type":"integer","format":"int64","description":"The total number of crates on crates.io.","example":123456},"num_downloads":{"type":"integer","format":"int64","description":"The total number of downloads across all crates.","example":123456789},"popular_categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"The 10 most popular categories."},"popular_keywords":{"type":"array","items":{"$ref":"#/components/schemas/Keyword"},"description":"The 10 most popular keywords."}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/teams/{team}":{"get":{"tags":["teams"],"summary":"Find team by login.","operationId":"find_team","parameters":[{"name":"team","in":"path","description":"Name of the team","required":true,"schema":{"type":"string"},"example":"github:rust-lang:crates-io"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting a team by login.","required":["team"],"properties":{"team":{"$ref":"#/components/schemas/Team"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/tokens/current":{"delete":{"tags":["api_tokens"],"summary":"Revoke the current API token.","description":"This endpoint revokes the API token that is used to authenticate\nthe request.","operationId":"revoke_current_api_token","responses":{"204":{"description":"Successful Response"},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]}]}},"/api/v1/trusted_publishing/github_configs":{"get":{"tags":["trusted_publishing"],"summary":"List Trusted Publishing configurations for GitHub Actions.","operationId":"list_trustpub_github_configs","parameters":[{"name":"crate","in":"query","description":"Name of the crate to list Trusted Publishing configurations for.","required":false,"schema":{"type":"string"}},{"name":"user_id","in":"query","description":"User ID to list Trusted Publishing configurations for all crates owned by the user.","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when listing GitHub trusted publishing configurations.","required":["github_configs","meta"],"properties":{"github_configs":{"type":"array","items":{"$ref":"#/components/schemas/GitHubConfig"}},"meta":{"type":"object","description":"Pagination metadata for a GitHub configuration list response.","required":["total","next_page"],"properties":{"next_page":{"type":["string","null"],"description":"Query string to the next page of results, if any.","example":"?seek=abc123"},"total":{"type":"integer","format":"int64","description":"The total number of GitHub configs belonging to the crate.","example":42}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"cookie":[]},{"api_token":[]}]},"post":{"tags":["trusted_publishing"],"summary":"Create a new Trusted Publishing configuration for GitHub Actions.","operationId":"create_trustpub_github_config","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["github_config"],"properties":{"github_config":{"type":"object","required":["crate","repository_owner","repository_name","workflow_filename"],"properties":{"crate":{"type":"string","example":"regex"},"environment":{"type":["string","null"],"example":null},"repository_name":{"type":"string","example":"regex"},"repository_owner":{"type":"string","example":"rust-lang"},"workflow_filename":{"type":"string","example":"ci.yml"}}}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["github_config"],"properties":{"github_config":{"$ref":"#/components/schemas/GitHubConfig"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"cookie":[]},{"api_token":[]}]}},"/api/v1/trusted_publishing/github_configs/{id}":{"delete":{"tags":["trusted_publishing"],"summary":"Delete Trusted Publishing configuration for GitHub Actions.","operationId":"delete_trustpub_github_config","parameters":[{"name":"id","in":"path","description":"ID of the Trusted Publishing configuration","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"Successful Response"},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"cookie":[]},{"api_token":[]}]}},"/api/v1/trusted_publishing/gitlab_configs":{"get":{"tags":["trusted_publishing"],"summary":"List Trusted Publishing configurations for GitLab CI/CD.","operationId":"list_trustpub_gitlab_configs","parameters":[{"name":"crate","in":"query","description":"Name of the crate to list Trusted Publishing configurations for.","required":false,"schema":{"type":"string"}},{"name":"user_id","in":"query","description":"User ID to list Trusted Publishing configurations for all crates owned by the user.","required":false,"schema":{"type":"integer","format":"int32"}},{"name":"page","in":"query","description":"The page number to request.\n\nThis parameter is mutually exclusive with `seek` and not supported for\nall requests.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"per_page","in":"query","description":"The number of items to request per page.","required":false,"schema":{"type":"integer","format":"int32","minimum":1}},{"name":"seek","in":"query","description":"The seek key to request.\n\nThis parameter is mutually exclusive with `page` and not supported for\nall requests.\n\nThe seek key can usually be found in the `meta.next_page` field of\npaginated responses.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when listing GitLab trusted publishing configurations.","required":["gitlab_configs","meta"],"properties":{"gitlab_configs":{"type":"array","items":{"$ref":"#/components/schemas/GitLabConfig"}},"meta":{"type":"object","description":"Pagination metadata for a GitLab configuration list response.","required":["total","next_page"],"properties":{"next_page":{"type":["string","null"],"description":"Query string to the next page of results, if any.","example":"?seek=abc123"},"total":{"type":"integer","format":"int64","description":"The total number of GitLab configs belonging to the crate.","example":42}}}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"cookie":[]},{"api_token":[]}]},"post":{"tags":["trusted_publishing"],"operationId":"create_trustpub_gitlab_config","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["gitlab_config"],"properties":{"gitlab_config":{"type":"object","required":["crate","namespace","project","workflow_filepath"],"properties":{"crate":{"type":"string","example":"regex"},"environment":{"type":["string","null"],"example":null},"namespace":{"type":"string","example":"rust-lang"},"project":{"type":"string","example":"regex"},"workflow_filepath":{"type":"string","example":".gitlab-ci.yml"}}}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["gitlab_config"],"properties":{"gitlab_config":{"$ref":"#/components/schemas/GitLabConfig"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"cookie":[]},{"api_token":[]}]}},"/api/v1/trusted_publishing/gitlab_configs/{id}":{"delete":{"tags":["trusted_publishing"],"summary":"Delete Trusted Publishing configuration for GitLab CI/CD.","operationId":"delete_trustpub_gitlab_config","parameters":[{"name":"id","in":"path","description":"ID of the Trusted Publishing configuration","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"204":{"description":"Successful Response"},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"cookie":[]},{"api_token":[]}]}},"/api/v1/trusted_publishing/tokens":{"post":{"tags":["trusted_publishing"],"summary":"Exchange an OIDC token for a temporary access token.","operationId":"exchange_trustpub_token","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["jwt"],"properties":{"jwt":{"type":"string"}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["token"],"properties":{"token":{"type":"string"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"delete":{"tags":["trusted_publishing"],"summary":"Revoke a temporary access token.","description":"The access token is expected to be passed in the `Authorization` header\nas a `Bearer` token, similar to how it is used in the publish endpoint.","operationId":"revoke_trustpub_token","responses":{"204":{"description":"Successful Response"},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"trustpub_token":[]}]}},"/api/v1/users/{id}/resend":{"put":{"tags":["users"],"summary":"Regenerate and send an email verification token.","operationId":"resend_email_verification","parameters":[{"name":"id","in":"path","description":"ID of the user","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}},"/api/v1/users/{id}/stats":{"get":{"tags":["users"],"summary":"Get user stats.","description":"This currently only returns the total number of downloads for crates owned\nby the user.","operationId":"get_user_stats","parameters":[{"name":"id","in":"path","description":"ID of the user","required":true,"schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["total_downloads"],"properties":{"total_downloads":{"type":"integer","format":"int64","description":"The total number of downloads for crates owned by the user.","example":123456789,"minimum":0}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}}},"/api/v1/users/{user}":{"get":{"tags":["users"],"summary":"Find user by login.","operationId":"find_user","parameters":[{"name":"user","in":"path","description":"crates.io username","required":true,"schema":{"type":"string"}},{"name":"include","in":"query","description":"Additional data to include in the response.\n\nValid values: `linked_accounts`.\n\nDefaults to no additional data.\n\nThis parameter expects a comma-separated list of values.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","description":"Response returned when getting a user by login.","required":["user"],"properties":{"linked_accounts":{"type":"array","items":{"$ref":"#/components/schemas/LinkedAccount"},"description":"Public linked accounts, if the client requested them."},"user":{"$ref":"#/components/schemas/User"}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}}},"put":{"tags":["users"],"summary":"Update user settings.","description":"This endpoint allows users to update their email address and publish notifications settings.\n\nThe `id` parameter needs to match the ID of the currently authenticated user.","operationId":"update_user","parameters":[{"name":"user","in":"path","description":"ID of the user","required":true,"schema":{"type":"integer","format":"int32"}}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["user"],"properties":{"user":{"type":"object","properties":{"email":{"type":["string","null"]},"publish_notifications":{"type":["boolean","null"]}}}}}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean","example":true}}}}}},"4XX":{"description":"Client Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}},"5XX":{"description":"Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiErrorResponse"}}}}},"security":[{"api_token":[]},{"cookie":[]}]}}},"components":{"schemas":{"ApiErrorResponse":{"type":"object","description":"The JSON envelope returned for API errors.","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","description":"A human-readable API error.","required":["detail"],"properties":{"detail":{"type":"string","description":"A description of the error."}}},"description":"The errors that prevented the request from succeeding."}}},"ApiToken":{"type":"object","description":"The model representing a row in the `api_tokens` database table.","required":["id","name","created_at","last_used_at","crate_scopes","endpoint_scopes","expired_at"],"properties":{"crate_scopes":{"type":["array","null"],"items":{"type":"string"},"description":"`None` or a list of crate scope patterns (see RFC #2947).","example":["serde"]},"created_at":{"type":"string","format":"date-time","description":"The date and time when the token was created.","example":"2017-01-06T14:23:11Z"},"endpoint_scopes":{"type":["array","null"],"items":{"$ref":"#/components/schemas/EndpointScope"},"description":"A list of endpoint scopes or `None` for the `legacy` endpoint scope (see RFC #2947).","example":["publish-update"]},"expired_at":{"type":["string","null"],"format":"date-time","description":"The date and time when the token will expire, or `null`.","example":"2030-10-26T11:32:12Z"},"id":{"type":"integer","format":"int32","description":"An opaque unique identifier for the token.","example":42},"last_used_at":{"type":["string","null"],"format":"date-time","description":"The date and time when the token was last used.","example":"2021-10-26T11:32:12Z"},"name":{"type":"string","description":"The name of the token.","example":"Example API Token"}}},"ApiTokenWithToken":{"allOf":[{"$ref":"#/components/schemas/ApiToken"},{"type":"object","required":["token"],"properties":{"token":{"type":"string","description":"The plaintext API token.\n\nOnly available when the token is created.","example":"a1b2c3d4e5f6g7h8i9j0"}}}]},"AuthenticatedUser":{"type":"object","required":["id","login","email_verified","email_verification_sent","name","email","avatar","url","is_admin","publish_notifications","created_at"],"properties":{"avatar":{"type":["string","null"],"description":"The user's avatar URL, if set.","example":"https://avatars2.githubusercontent.com/u/1234567?v=4"},"created_at":{"type":["string","null"],"format":"date-time","description":"The date and time the user was created.\n\nFor users created before June 19, 2026, the creation time will be the\ntime the user's GitHub account was created. If the GitHub account was\ndeleted before June 19, 2026, this field will be empty."},"email":{"type":["string","null"],"description":"The user's email address, if set.","example":"kate@morgan.dev"},"email_verification_sent":{"type":"boolean","description":"Whether the user's email address verification email has been sent.","example":true},"email_verified":{"type":"boolean","description":"Whether the user's email address has been verified.","example":true},"id":{"type":"integer","format":"int32","description":"An opaque identifier for the user.","example":42},"is_admin":{"type":"boolean","description":"Whether the user is a crates.io administrator.","example":false},"login":{"type":"string","description":"The user's login name.","example":"ghost"},"name":{"type":["string","null"],"description":"The user's display name, if set.","example":"Kate Morgan"},"publish_notifications":{"type":"boolean","description":"Whether the user has opted in to receive publish notifications via email.","example":true},"url":{"type":"string","description":"The user's GitHub profile URL.","deprecated":true,"example":"https://github.com/ghost"}}},"Category":{"type":"object","required":["id","category","slug","description","created_at","crates_cnt"],"properties":{"category":{"type":"string","description":"The name of the category.","example":"Game development"},"crates_cnt":{"type":"integer","format":"int32","description":"The total number of crates that have this category.","example":42},"created_at":{"type":"string","format":"date-time","description":"The date and time this category was created.","example":"2019-12-13T13:46:41Z"},"description":{"type":"string","description":"A description of the category.","example":"Libraries for creating games."},"id":{"type":"string","description":"An opaque identifier for the category.","example":"game-development"},"parent_categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"The parent categories of this category.\n\nThis field is only present when the category details are queried,\nbut not when listing categories.","example":[]},"slug":{"type":"string","description":"The \"slug\" of the category.\n\nSee <https://crates.io/category_slugs>.","example":"game-development"},"subcategories":{"type":"array","items":{"$ref":"#/components/schemas/Category"},"description":"The subcategories of this category.\n\nThis field is only present when the category details are queried,\nbut not when listing categories.","example":[]}}},"Crate":{"type":"object","required":["id","name","updated_at","versions","keywords","categories","badges","created_at","downloads","recent_downloads","default_version","num_versions","yanked","max_version","newest_version","max_stable_version","description","homepage","documentation","repository","links","exact_match","trustpub_only"],"properties":{"badges":{"type":"array","items":{"type":"object"},"deprecated":true,"example":[]},"categories":{"type":["array","null"],"items":{"type":"string"},"description":"The list of categories belonging to this crate.","example":null},"created_at":{"type":"string","format":"date-time","description":"The date and time this crate was created.","example":"2019-12-13T13:46:41Z"},"default_version":{"type":["string","null"],"description":"The \"default\" version of this crate.\n\nThis version will be displayed by default on the crate's page.","example":"1.3.0"},"description":{"type":["string","null"],"description":"Description of the crate.","example":"A generic serialization/deserialization framework"},"documentation":{"type":["string","null"],"description":"The URL to the crate's documentation, if set.","example":"https://docs.rs/serde"},"downloads":{"type":"integer","format":"int64","description":"The total number of downloads for this crate.","example":123456789},"exact_match":{"type":"boolean","description":"Whether the crate name was an exact match.","deprecated":true},"homepage":{"type":["string","null"],"description":"The URL to the crate's homepage, if set.","example":"https://serde.rs"},"id":{"type":"string","description":"An opaque identifier for the crate.","example":"serde"},"keywords":{"type":["array","null"],"items":{"type":"string"},"description":"The list of keywords belonging to this crate.","example":null},"links":{"$ref":"#/components/schemas/CrateLinks","description":"Links to other API endpoints related to this crate."},"max_stable_version":{"type":["string","null"],"description":"The highest version number for this crate that is not a pre-release.","deprecated":true,"example":"1.3.0"},"max_version":{"type":"string","description":"The highest version number for this crate.","deprecated":true,"example":"2.0.0-beta.1"},"name":{"type":"string","description":"The name of the crate.","example":"serde"},"newest_version":{"type":"string","description":"The most recently published version for this crate.","deprecated":true,"example":"1.2.3"},"num_versions":{"type":"integer","format":"int32","description":"The total number of versions for this crate.","example":13},"recent_downloads":{"type":["integer","null"],"format":"int64","description":"The total number of downloads for this crate in the last 90 days.","example":456789},"repository":{"type":["string","null"],"description":"The URL to the crate's repository, if set.","example":"https://github.com/serde-rs/serde"},"trustpub_only":{"type":"boolean","description":"Whether this crate can only be published via Trusted Publishing."},"updated_at":{"type":"string","format":"date-time","description":"The date and time this crate was last updated.","example":"2019-12-13T13:46:41Z"},"versions":{"type":["array","null"],"items":{"type":"integer","format":"int32"},"description":"The list of version IDs belonging to this crate.","example":null},"yanked":{"type":"boolean","description":"Whether all versions of this crate have been yanked."}}},"CrateLinks":{"type":"object","required":["version_downloads","versions","owners","owner_team","owner_user","reverse_dependencies"],"properties":{"owner_team":{"type":"string","description":"The API path to this crate's team owners.","example":"/api/v1/crates/serde/owner_team"},"owner_user":{"type":"string","description":"The API path to this crate's user owners.","example":"/api/v1/crates/serde/owner_user"},"owners":{"type":"string","description":"The API path to this crate's owners.","example":"/api/v1/crates/serde/owners"},"reverse_dependencies":{"type":"string","description":"The API path to this crate's reverse dependencies.","example":"/api/v1/crates/serde/reverse_dependencies"},"version_downloads":{"type":"string","description":"The API path to this crate's download statistics.","example":"/api/v1/crates/serde/downloads"},"versions":{"type":["string","null"],"description":"The API path to this crate's versions.","example":"/api/v1/crates/serde/versions"}}},"CrateOwnerInvitation":{"type":"object","required":["invitee_id","inviter_id","crate_id","crate_name","created_at","expires_at"],"properties":{"crate_id":{"type":"integer","format":"int32","description":"The ID of the crate that the user was invited to be an owner of.","example":123},"crate_name":{"type":"string","description":"The name of the crate that the user was invited to be an owner of.","example":"serde"},"created_at":{"type":"string","format":"date-time","description":"The date and time this invitation was created.","example":"2019-12-13T13:46:41Z"},"expires_at":{"type":"string","format":"date-time","description":"The date and time this invitation will expire.","example":"2020-01-13T13:46:41Z"},"invitee_id":{"type":"integer","format":"int32","description":"The ID of the user who was invited to be a crate owner.","example":42},"inviter_id":{"type":"integer","format":"int32","description":"The ID of the user who sent the invitation.","example":3}}},"Dependency":{"type":"object","required":["id","version_id","crate_id","req","optional","default_features","features","target","kind","downloads"],"properties":{"crate_id":{"type":"string","description":"The name of the crate this dependency points to.","example":"serde"},"default_features":{"type":"boolean","description":"Whether default features are enabled for this dependency.","example":true},"downloads":{"type":"integer","format":"int64","description":"The total number of downloads for the crate this dependency points to.","example":123456},"features":{"type":"array","items":{"type":"string"},"description":"The features explicitly enabled for this dependency."},"id":{"type":"integer","format":"int32","description":"An opaque identifier for the dependency.","example":169},"kind":{"type":"string","description":"The type of dependency this is (normal, dev, or build).","example":"normal"},"optional":{"type":"boolean","description":"Whether this dependency is optional."},"req":{"type":"string","description":"The version requirement for this dependency.","example":"^1"},"target":{"type":["string","null"],"description":"The target platform for this dependency, if any."},"version_id":{"type":"integer","format":"int32","description":"The ID of the version this dependency belongs to.","example":42}}},"EndpointScope":{"type":"string","enum":["publish-new","publish-update","trusted-publishing","yank","change-owners"]},"GitHubConfig":{"type":"object","required":["id","crate","repository_owner","repository_owner_id","repository_name","workflow_filename","environment","created_at"],"properties":{"crate":{"type":"string","example":"regex"},"created_at":{"type":"string","format":"date-time"},"environment":{"type":["string","null"],"example":null},"id":{"type":"integer","format":"int32","example":42},"repository_name":{"type":"string","example":"regex"},"repository_owner":{"type":"string","example":"rust-lang"},"repository_owner_id":{"type":"integer","format":"int32","example":5430905},"workflow_filename":{"type":"string","example":"ci.yml"}}},"GitLabConfig":{"type":"object","required":["id","crate","namespace","namespace_id","project","workflow_filepath","environment","created_at"],"properties":{"crate":{"type":"string","example":"regex"},"created_at":{"type":"string","format":"date-time"},"environment":{"type":["string","null"],"example":null},"id":{"type":"integer","format":"int32","example":42},"namespace":{"type":"string","example":"rust-lang"},"namespace_id":{"type":["string","null"],"example":null},"project":{"type":"string","example":"regex"},"workflow_filepath":{"type":"string","example":".gitlab-ci.yml"}}},"Keyword":{"type":"object","required":["id","keyword","created_at","crates_cnt"],"properties":{"crates_cnt":{"type":"integer","format":"int32","description":"The total number of crates that have this keyword.","example":42},"created_at":{"type":"string","format":"date-time","description":"The date and time this keyword was created.","example":"2017-01-06T14:23:11Z"},"id":{"type":"string","description":"An opaque identifier for the keyword.","example":"http"},"keyword":{"type":"string","description":"The keyword itself.","example":"http"}}},"LegacyCrateOwnerInvitation":{"type":"object","required":["invitee_id","inviter_id","invited_by_username","crate_name","crate_id","created_at","expires_at"],"properties":{"crate_id":{"type":"integer","format":"int32","description":"The ID of the crate that the user was invited to be an owner of.","example":123},"crate_name":{"type":"string","description":"The name of the crate that the user was invited to be an owner of.","example":"serde"},"created_at":{"type":"string","format":"date-time","description":"The date and time this invitation was created.","example":"2019-12-13T13:46:41Z"},"expires_at":{"type":"string","format":"date-time","description":"The date and time this invitation will expire.","example":"2020-01-13T13:46:41Z"},"invited_by_username":{"type":"string","description":"The username of the user who sent the invitation.","example":"ghost"},"invitee_id":{"type":"integer","format":"int32","description":"The ID of the user who was invited to be a crate owner.","example":42},"inviter_id":{"type":"integer","format":"int32","description":"The ID of the user who sent the invitation.","example":3}}},"LinkedAccount":{"oneOf":[{"type":"object","description":"A linked GitHub account.","required":["account_id","login","avatar","provider"],"properties":{"account_id":{"type":"string","description":"The stable GitHub account ID."},"avatar":{"type":["string","null"],"description":"The GitHub avatar URL."},"login":{"type":"string","description":"The GitHub username."},"provider":{"type":"string","enum":["github"]}}}],"description":"This type contains public data for an external account of a crates.io user."},"Owner":{"oneOf":[{"type":"object","description":"A user owner.","required":["id","login","url","name","avatar","github_username_matches","kind"],"properties":{"avatar":{"type":["string","null"],"description":"The user's avatar URL.","example":"https://avatars2.githubusercontent.com/u/1234567?v=4"},"github_username_matches":{"type":"boolean","description":"Whether a linked GitHub username exactly matches the crates.io username."},"id":{"type":"integer","format":"int32","description":"The opaque identifier for the user.","example":42},"kind":{"type":"string","enum":["user"]},"login":{"type":"string","description":"The crates.io username.","example":"ghost"},"name":{"type":["string","null"],"description":"The user's display name.","example":"Kate Morgan"},"url":{"type":"string","description":"The URL to the user's GitHub profile.","example":"https://github.com/ghost"}}},{"type":"object","description":"A team owner.","required":["id","login","url","name","avatar","kind"],"properties":{"avatar":{"type":["string","null"],"description":"The team's avatar URL.","example":"https://avatars2.githubusercontent.com/u/1234567?v=4"},"id":{"type":"integer","format":"int32","description":"The opaque identifier for the team.","example":42},"kind":{"type":"string","enum":["team"]},"login":{"type":"string","description":"The team's login name.","example":"github:rust-lang:crates-io"},"name":{"type":["string","null"],"description":"The team's display name.","example":"Crates.io team"},"url":{"type":["string","null"],"description":"The URL to the team's GitHub profile.","example":"https://github.com/rust-lang"}}}],"description":"A user or team that owns a crate."},"PublishWarnings":{"type":"object","required":["invalid_categories","invalid_badges","other"],"properties":{"invalid_badges":{"type":"array","items":{"type":"string"},"deprecated":true,"example":[]},"invalid_categories":{"type":"array","items":{"type":"string"},"example":[]},"other":{"type":"array","items":{"type":"string"},"example":[]}}},"ReleaseTrackDetails":{"type":"object","required":["highest"],"properties":{"highest":{"type":"string"}}},"SignupDetails":{"type":"object","description":"Public GitHub account details displayed while a user completes signup.","required":["login","email"],"properties":{"email":{"type":["string","null"],"description":"The email address suggested by GitHub, if one is available."},"login":{"type":"string","description":"The GitHub account login."}}},"Slug":{"type":"object","required":["id","slug","description"],"properties":{"description":{"type":"string","description":"A description of the category.","example":"Libraries for creating games."},"id":{"type":"string","description":"An opaque identifier for the category.","example":"game-development"},"slug":{"type":"string","description":"The \"slug\" of the category.\n\nSee <https://crates.io/category_slugs>.","example":"game-development"}}},"Team":{"type":"object","required":["id","login","name","avatar","url"],"properties":{"avatar":{"type":["string","null"],"description":"The avatar URL of the team.","example":"https://avatars2.githubusercontent.com/u/1234567?v=4"},"id":{"type":"integer","format":"int32","description":"An opaque identifier for the team.","example":42},"login":{"type":"string","description":"The login name of the team.","example":"github:rust-lang:crates-io"},"name":{"type":["string","null"],"description":"The display name of the team.","example":"Crates.io team"},"url":{"type":["string","null"],"description":"The GitHub profile URL of the team.","example":"https://github.com/rust-lang"}}},"TrustpubData":{"oneOf":[{"type":"object","required":["repository","run_id","sha","provider"],"properties":{"provider":{"type":"string","enum":["github"]},"repository":{"type":"string","description":"Repository (e.g. \"octo-org/octo-repo\")"},"run_id":{"type":"string","description":"Workflow run ID"},"sha":{"type":"string","description":"SHA of the commit"}}},{"type":"object","required":["project_path","job_id","sha","provider"],"properties":{"job_id":{"type":"string","description":"Job ID"},"project_path":{"type":"string","description":"Project path (e.g. \"rust-lang/cargo\")"},"provider":{"type":"string","enum":["gitlab"]},"sha":{"type":"string","description":"SHA of the commit"}}}],"description":"Data structure containing trusted publisher information extracted from JWT claims"},"User":{"type":"object","required":["id","login","name","avatar","url","github_username_matches","created_at"],"properties":{"avatar":{"type":["string","null"],"description":"The user's avatar URL, if set.","example":"https://avatars2.githubusercontent.com/u/1234567?v=4"},"created_at":{"type":["string","null"],"format":"date-time","description":"The date and time the user was created.\n\nFor users created before June 19, 2026, the creation time will be the\ntime the user's GitHub account was created. If the GitHub account was\ndeleted before June 19, 2026, this field will be empty."},"github_username_matches":{"type":"boolean","description":"Whether a linked GitHub username exactly matches the crates.io username."},"id":{"type":"integer","format":"int32","description":"An opaque identifier for the user.","example":42},"login":{"type":"string","description":"The user's login name.","example":"ghost"},"name":{"type":["string","null"],"description":"The user's display name, if set.","example":"Kate Morgan"},"url":{"type":"string","description":"The user's GitHub profile URL.","deprecated":true,"example":"https://github.com/ghost"}}},"Version":{"type":"object","required":["id","crate","num","dl_path","readme_path","updated_at","created_at","downloads","features","yanked","yank_message","lib_links","license","links","crate_size","published_by","audit_actions","checksum","rust_version","has_lib","bin_names","edition","description","homepage","documentation","repository","trustpub_data","linecounts"],"properties":{"audit_actions":{"type":"array","items":{"type":"object","required":["action","user","time"],"properties":{"action":{"type":"string","description":"The action that was performed.","example":"publish"},"time":{"type":"string","format":"date-time","description":"The date and time the action was performed.","example":"2019-12-13T13:46:41Z"},"user":{"$ref":"#/components/schemas/User","description":"The user who performed the action."}}},"description":"A list of actions performed on this version."},"bin_names":{"type":["array","null"],"items":{"type":["string","null"]},"description":"The names of the binaries provided by this version, if any.","example":[]},"checksum":{"type":"string","description":"The SHA256 checksum of the compressed crate file encoded as a\nhexadecimal string.","example":"e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60"},"crate":{"type":"string","description":"The name of the crate.","example":"serde"},"crate_size":{"type":"integer","format":"int32","description":"The size of the compressed crate file in bytes.","example":1234},"created_at":{"type":"string","format":"date-time","description":"The date and time this version was created.","example":"2019-12-13T13:46:41Z"},"description":{"type":["string","null"],"description":"The description of this version of the crate.","example":"A generic serialization/deserialization framework"},"dl_path":{"type":"string","description":"The API path to download the crate.","example":"/api/v1/crates/serde/1.0.0/download"},"documentation":{"type":["string","null"],"description":"The URL to the crate's documentation, if set.","example":"https://docs.rs/serde"},"downloads":{"type":"integer","format":"int32","description":"The total number of downloads for this version.","example":123456},"edition":{"type":["string","null"],"description":"The Rust Edition used to compile this version, if set.","example":"2021"},"features":{"type":"object","description":"The features defined by this version.","additionalProperties":{"type":"array","items":{"type":"string"}},"propertyNames":{"type":"string"}},"has_lib":{"type":["boolean","null"],"description":"Whether this version can be used as a library.","example":true},"homepage":{"type":["string","null"],"description":"The URL to the crate's homepage, if set.","example":"https://serde.rs"},"id":{"type":"integer","format":"int32","description":"An opaque identifier for the version.","example":42},"lib_links":{"type":["string","null"],"description":"The name of the native library this version links with, if any.","example":"git2"},"license":{"type":["string","null"],"description":"The license of this version of the crate.","example":"MIT"},"linecounts":{"type":["object","null"],"description":"Line count statistics for this version.\n\nStatus: **Unstable**\n\nThis field may be `null` until the version has been analyzed, which\nhappens in an asynchronous background job.","additionalProperties":{},"propertyNames":{"type":"string"}},"links":{"$ref":"#/components/schemas/VersionLinks","description":"Links to other API endpoints related to this version."},"num":{"type":"string","description":"The version number.","example":"1.0.0"},"published_by":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/User","description":"The user who published this version.\n\nThis field may be `null` if the version was published before crates.io\nstarted recording this information."}]},"readme_path":{"type":"string","description":"The API path to download the crate's README file as HTML code.","example":"/api/v1/crates/serde/1.0.0/readme"},"repository":{"type":["string","null"],"description":"The URL to the crate's repository, if set.","example":"https://github.com/serde-rs/serde"},"rust_version":{"type":["string","null"],"description":"The minimum version of the Rust compiler required to compile\nthis version, if set.","example":"1.31"},"trustpub_data":{"oneOf":[{"type":"null"},{"$ref":"#/components/schemas/TrustpubData","description":"Information about the trusted publisher that published this version, if any.\n\nStatus: **Unstable**\n\nThis field is filled if the version was published via trusted publishing\n(e.g., GitHub Actions) rather than a regular API token.\n\nThe exact structure of this field depends on the `provider` field\ninside it."}]},"updated_at":{"type":"string","format":"date-time","description":"The date and time this version was last updated (i.e. yanked or unyanked).","example":"2019-12-13T13:46:41Z"},"yank_message":{"type":["string","null"],"description":"The message given when this version was yanked, if any.","example":"Security vulnerability"},"yanked":{"type":"boolean","description":"Whether this version has been yanked.","example":false}}},"VersionDownload":{"type":"object","required":["version","downloads","date"],"properties":{"date":{"type":"string","description":"The date this download count is for.","example":"2019-12-13"},"downloads":{"type":"integer","format":"int32","description":"The number of downloads for this version on the given date.","example":123},"version":{"type":"integer","format":"int32","description":"The ID of the version this download count is for.","example":42}}},"VersionLinks":{"type":"object","required":["dependencies","version_downloads","authors"],"properties":{"authors":{"type":"string","description":"The API path to download this version's authors.","deprecated":true,"example":"/api/v1/crates/serde/1.0.0/authors"},"dependencies":{"type":"string","description":"The API path to download this version's dependencies.","example":"/api/v1/crates/serde/1.0.0/dependencies"},"version_downloads":{"type":"string","description":"The API path to download this version's download numbers.","example":"/api/v1/crates/serde/1.0.0/downloads"}}},"VersionUpdate":{"type":"object","properties":{"yank_message":{"type":["string","null"]},"yanked":{"type":["boolean","null"]}}}},"securitySchemes":{"api_token":{"type":"apiKey","in":"header","name":"authorization","description":"The API token is used to authenticate requests from cargo and other clients."},"cookie":{"type":"apiKey","in":"cookie","name":"cargo_session","description":"The session cookie is used by the web UI to authenticate users."},"trustpub_token":{"type":"http","scheme":"bearer","description":"Temporary access tokens are used by the \"Trusted Publishing\" flow."}}}}