1Password API
  1. Items
1Password API
  • auth
    • Performs introspection of the provided Bearer JWT token
      GET
  • api-v1
    • Retrieves item usages
      POST
    • Retrieves sign-in attempts
      POST
  • Activity
    • Retrieve a list of API Requests that have been made.
      GET
  • Vaults
    • Get all Vaults
      GET
    • Get Vault details and metadata
      GET
  • Items
    • Get all items for inside a Vault
      GET
    • Create a new Item
      POST
    • Get the details of an Item
      GET
    • Update an Item
      PUT
    • Delete an Item
      DELETE
    • Update a subset of Item attributes
      PATCH
  • Files
    • Get all the files inside an Item
      GET
    • Get the content of a File
      GET
    • Get the details of a File
      GET
  • Health
    • Ping the server for liveness
      GET
    • Get state of the server and its dependencies.
      GET
  • Metrics
    • Query server for exposed Prometheus metrics
      GET
  1. Items

Update a subset of Item attributes

PATCH
/vaults/{vaultUuid}/items/{itemUuid}
Items
Applies a modified RFC6902 JSON Patch document to an Item or ItemField. This endpoint only supports add, remove and replace operations.
When modifying a specific ItemField, the ItemField's ID in the path attribute of the operation object: /fields/{fieldId}
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location -g --request PATCH 'http://localhost:8080/v1/vaults//items/' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "op": "replace",
        "path": "/favorite",
        "value": true
    },
    {
        "op": "remove",
        "path": "/tags/1"
    }
]'
响应示例响应示例
200 - 示例 1
{
  "id": "string",
  "title": "string",
  "favorite": false,
  "version": 0,
  "createdAt": "2019-08-24T14:15:22Z",
  "updatedAt": "2019-08-24T14:15:22Z",
  "lastEditedBy": "string",
  "category": "LOGIN",
  "tags": [
    "string"
  ],
  "state": "ARCHIVED",
  "vault": {
    "id": "string"
  },
  "urls": [
    {
      "primary": true,
      "href": "https://example.com"
    },
    {
      "href": "https://example.org"
    }
  ],
  "fields": [
    {
      "recipe": {
        "length": 32,
        "excludeCharacters": "abc1",
        "characterSets": [
          "LETTERS"
        ]
      },
      "id": "string",
      "label": "string",
      "value": "string",
      "generate": false,
      "entropy": 0,
      "type": "STRING",
      "purpose": "",
      "section": {
        "id": "string"
      }
    }
  ],
  "files": [
    {
      "id": "6r65pjq33banznomn7q22sj44e",
      "name": "foo.txt",
      "size": 35,
      "content_path": "v1/vaults/ionaiwtdvgclrixbt6ztpqcxnq/items/p7eflcy7f5mk7vg6zrzf5rjjyu/files/6r65pjq33banznomn7q22sj44e/content",
      "content": "VGhlIGZ1dHVyZSBiZWxvbmdzIHRvIHRoZSBjdXJpb3VzLgo="
    }
  ],
  "sections": [
    {
      "id": "string",
      "label": "string"
    }
  ]
}

请求参数

Path 参数
vaultUuid
string 
必需
The UUID of the Vault the item is in
正则匹配:
^[\da-z]{26}$
itemUuid
string 
必需
The UUID of the Item to update
正则匹配:
^[\da-z]{26}$
Body 参数application/json
array of:
path
string 
必需
An RFC6901 JSON Pointer pointing to the Item document, an Item Attribute, and Item Field by Field ID, or an Item Field Attribute
示例值:
/fields/06gnn2b95example10q91512p5/label
value
object 
可选
op
enum<string> 
必需
枚举值:
addremovereplace
示例

返回响应

🟢200成功
application/json
OK - Item updated. If no Patch operations were provided, Item is unmodified.
Body
id
string 
可选
正则匹配:
^[\da-z]{26}$
title
string 
可选
favorite
boolean 
可选
默认值:
false
version
integer 
可选
createdAt
string <date-time>
只读可选
updatedAt
string <date-time>
只读可选
lastEditedBy
string 
只读可选
category
enum<string> 
必需
枚举值:
LOGINPASSWORDAPI_CREDENTIALSERVERDATABASECREDIT_CARDMEMBERSHIPPASSPORTSOFTWARE_LICENSEOUTDOOR_LICENSESECURE_NOTEWIRELESS_ROUTERBANK_ACCOUNTDRIVER_LICENSEIDENTITYREWARD_PROGRAMDOCUMENTEMAIL_ACCOUNTSOCIAL_SECURITY_NUMBERMEDICAL_RECORDSSH_KEYCUSTOM
tags
array[string]
可选
state
enum<string> 
只读可选
枚举值:
ARCHIVEDDELETED
vault
object 
必需
id
string 
必需
正则匹配:
^[\da-z]{26}$
urls
array [object {3}] 
可选
示例值:
[{"primary":true,"href":"https://example.com"},{"href":"https://example.org"}]
label
string 
可选
primary
boolean 
可选
href
string <url>
必需
fields
array[object (Field) {9}] 
可选
recipe
object 
GeneratorRecipe
可选
The recipe is used in conjunction with the "generate" property to set the character set used to generate a new secure value
id
string 
必需
label
string 
可选
value
string 
可选
generate
boolean 
可选
If value is not present then a new value should be generated for this field
默认值:
false
entropy
number 
只读可选
For fields with a purpose of PASSWORD this is the entropy of the value
type
enum<string> 
必需
枚举值:
STRINGEMAILCONCEALEDURLTOTPDATEMONTH_YEARMENU
默认值:
STRING
purpose
enum<string> 
可选
Some item types, Login and Password, have fields used for autofill. This property indicates that purpose and is required for some item types.
枚举值:
USERNAMEPASSWORDNOTES
section
object 
可选
files
array[object (File) {6}] 
可选
id
string 
可选
ID of the file
name
string 
可选
Name of the file
size
integer 
可选
Size in bytes of the file
content_path
string 
只读可选
Path of the Connect API that can be used to download the contents of this file.
content
string <byte>
可选

Base64-encoded contents of the file. Only set if size <= OP_MAX_INLINE_FILE_SIZE_KB kb and inline_files is set to true.

section
object 
可选
For files that are in a section, this field describes the section.
sections
array [object {2}] 
可选
id
string 
可选
label
string 
可选
🟠401没有权限
🟠403禁止访问
🟠404记录不存在

【1Password】API开发者 微信交流群

用微信扫右侧二维码,加入【1Password】API开发者 交流群,互助沟通

扫码加入交流群
上一页
Delete an Item
下一页
Get all the files inside an Item
Built with