Organizations (v2.0)

https://github.com/folio-org/mod-organizations-storage

Table of contents

Contacts

CRUD APIs used to manage contacts.

/organizations-storage/contacts

Collection of contact items.

GET /organizations-storage/contacts

Get list of contact persons

GET /organizations-storage/contacts
Query Parameters
  • query: (string)

    A query expressed as a CQL string (see dev.folio.org/reference/glossary#cql) using valid searchable fields. The first example below shows the general form of a full CQL query, but those fields might not be relevant in this context.

    with valid searchable fields: for example code

    Example:

    (username=="ab*" or personal.firstName=="ab*" or personal.lastName=="ab*") and active=="true" sortby personal.lastName personal.firstName barcode
    
    ["code", "MEDGRANT", "="]
    
  • offset: (integer - default: 0 - minimum: 0 - maximum: 2147483647)

    Skip over a number of elements by specifying an offset value for the query

    Example:

    0
  • limit: (integer - default: 10 - minimum: 0 - maximum: 2147483647)

    Limit the number of elements returned in the response

    Example:

    10
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns a list of contact items

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "collection of contact records",
  "type": "object",
  "properties": {
    "contacts": {
      "description": "The list of contacts in this collection",
      "type": "array",
      "id": "contacts",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A contact record",
        "properties": {
          "id": {
            "description": "The unique id of this contact",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "prefix": {
            "description": "The prefix for this contact person",
            "type": "string"
          },
          "firstName": {
            "description": "The first name of this contact person",
            "type": "string"
          },
          "lastName": {
            "description": "The last name of this contact person",
            "type": "string"
          },
          "language": {
            "description": "The preferred language for this contact person",
            "type": "string"
          },
          "notes": {
            "description": "The notes for this contact person",
            "type": "string"
          },
          "phoneNumbers": {
            "id": "phoneNumbers",
            "description": "The list of phone numbers for this contact person",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "A phone number record",
              "properties": {
                "id": {
                  "description": "UUID",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "phoneNumber": {
                  "description": "The entire sequence of digits for this phone number",
                  "type": "string"
                },
                "categories": {
                  "id": "categories",
                  "description": "The list of categories for this organization phone",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "type": {
                  "description": "The type of this phone number",
                  "type": "string",
                  "enum": [
                    "Office",
                    "Mobile",
                    "Fax",
                    "Other"
                  ]
                },
                "isPrimary": {
                  "description": "Used to set this phone number as primary for the contact",
                  "type": "boolean"
                },
                "language": {
                  "description": "The language for this organization phone",
                  "type": "string"
                },
                "metadata": {
                  "type": "object",
                  "readonly": true,
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "title": "Metadata Schema",
                  "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
                  "properties": {
                    "createdDate": {
                      "description": "Date and time when the record was created",
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdByUserId": {
                      "description": "ID of the user who created the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "createdByUsername": {
                      "description": "Username of the user who created the record (when available)",
                      "type": "string"
                    },
                    "updatedDate": {
                      "description": "Date and time when the record was last updated",
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedByUserId": {
                      "description": "ID of the user who last updated the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "updatedByUsername": {
                      "description": "Username of the user who last updated the record (when available)",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "createdDate"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "phoneNumber"
              ]
            }
          },
          "emails": {
            "id": "emailAddresses",
            "description": "The list of emails for this contact person",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "An email record",
              "properties": {
                "id": {
                  "description": "The unique id of this email",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "value": {
                  "description": "The value for this email",
                  "type": "string"
                },
                "description": {
                  "description": "The description for this email",
                  "type": "string"
                },
                "isPrimary": {
                  "description": "Used to set this email as primary for the contact",
                  "type": "boolean"
                },
                "categories": {
                  "id": "categories",
                  "description": "The list of categories for this organization email",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "language": {
                  "description": "The language for this organization email",
                  "type": "string"
                },
                "metadata": {
                  "type": "object",
                  "readonly": true,
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "title": "Metadata Schema",
                  "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
                  "properties": {
                    "createdDate": {
                      "description": "Date and time when the record was created",
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdByUserId": {
                      "description": "ID of the user who created the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "createdByUsername": {
                      "description": "Username of the user who created the record (when available)",
                      "type": "string"
                    },
                    "updatedDate": {
                      "description": "Date and time when the record was last updated",
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedByUserId": {
                      "description": "ID of the user who last updated the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "updatedByUsername": {
                      "description": "Username of the user who last updated the record (when available)",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "createdDate"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "value"
              ]
            }
          },
          "addresses": {
            "id": "addresses",
            "description": "The list of addresses for this contact person",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "An address record",
              "properties": {
                "id": {
                  "description": "UUID",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "addressLine1": {
                  "description": "The first line of this address",
                  "type": "string"
                },
                "addressLine2": {
                  "description": "The second line of this address",
                  "type": "string"
                },
                "city": {
                  "description": "The city for this address",
                  "type": "string"
                },
                "stateRegion": {
                  "description": "The state or region for this address",
                  "type": "string"
                },
                "zipCode": {
                  "description": "The zip code for this address",
                  "type": "string"
                },
                "country": {
                  "description": "The country for this address",
                  "type": "string"
                },
                "isPrimary": {
                  "description": "Used to set this address as primary for the contact",
                  "type": "boolean"
                },
                "categories": {
                  "id": "categories",
                  "description": "The list of categories for this organization address",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "language": {
                  "description": "The language for this organization address",
                  "type": "string"
                },
                "metadata": {
                  "type": "object",
                  "readonly": true,
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "title": "Metadata Schema",
                  "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
                  "properties": {
                    "createdDate": {
                      "description": "Date and time when the record was created",
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdByUserId": {
                      "description": "ID of the user who created the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "createdByUsername": {
                      "description": "Username of the user who created the record (when available)",
                      "type": "string"
                    },
                    "updatedDate": {
                      "description": "Date and time when the record was last updated",
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedByUserId": {
                      "description": "ID of the user who last updated the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "updatedByUsername": {
                      "description": "Username of the user who last updated the record (when available)",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "createdDate"
                  ]
                }
              },
              "additionalProperties": false
            }
          },
          "urls": {
            "id": "urls",
            "description": "The list of URLs for this contact person",
            "type": "array",
            "items": {
              "type": "object",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "description": "A URL record",
              "properties": {
                "id": {
                  "description": "The unique id of this url",
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "type": "string",
                  "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
                },
                "value": {
                  "description": "The value for this URL",
                  "type": "string",
                  "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
                },
                "description": {
                  "description": "The description for this URL",
                  "type": "string"
                },
                "language": {
                  "description": "The language for this organization URL",
                  "type": "string"
                },
                "isPrimary": {
                  "description": "Used to set this url as primary for the contact",
                  "type": "boolean"
                },
                "categories": {
                  "id": "categories",
                  "description": "The list of categories for this organization URL",
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "notes": {
                  "description": "The notes for this organization URL",
                  "type": "string"
                },
                "metadata": {
                  "type": "object",
                  "readonly": true,
                  "$schema": "http://json-schema.org/draft-04/schema#",
                  "title": "Metadata Schema",
                  "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
                  "properties": {
                    "createdDate": {
                      "description": "Date and time when the record was created",
                      "type": "string",
                      "format": "date-time"
                    },
                    "createdByUserId": {
                      "description": "ID of the user who created the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "createdByUsername": {
                      "description": "Username of the user who created the record (when available)",
                      "type": "string"
                    },
                    "updatedDate": {
                      "description": "Date and time when the record was last updated",
                      "type": "string",
                      "format": "date-time"
                    },
                    "updatedByUserId": {
                      "description": "ID of the user who last updated the record (when available)",
                      "type": "string",
                      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
                    },
                    "updatedByUsername": {
                      "description": "Username of the user who last updated the record (when available)",
                      "type": "string"
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "createdDate"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "value"
              ]
            }
          },
          "categories": {
            "id": "contactCategory",
            "description": "The list of contact categories associated with this organization contact person",
            "type": "array",
            "items": {
              "description": "UUID of the contact category",
              "$schema": "http://json-schema.org/draft-04/schema#",
              "type": "string",
              "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
            }
          },
          "inactive": {
            "description": "Used to indicate that a contact is no longer active",
            "type": "boolean",
            "default": false
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "firstName",
          "lastName"
        ]
      }
    },
    "totalRecords": {
      "description": "The number of contact person records returned in this collection",
      "type": "integer"
    }
  },
  "additionalProperties": false,
  "required": [
    "contacts",
    "totalRecords"
  ]
}

Example:

{
    "contacts": [
        {
            "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
            "prefix": "Director",
            "firstName": "Nick",
            "lastName": "Fury",
            "language": "en-us",
            "notes": "SHIELD's Big Kahuna",
            "inactive": false,
            "phoneNumbers": [
             {
                 "phoneNumber": "19789999999",
                 "categories": [
                     "0e3f9680-ab06-4565-af64-609b7364e6eb",
                     "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
                 ],
                 "language": "en-us",
                 "type": "Office",
                 "isPrimary": true
             }
            ],
            "emails": [
                {
                    "email": {
                        "value": "noreply@folio.org",
                        "description": "Main"
                    },
                    "categories": [
                        "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                        "56288fe8-8037-44da-8395-01d2d106dc54"
                    ],
                    "language": "en-us"
                }
            ],
            "addresses": [
                {
                    "address": {
                        "addressLine1": "10 Estes Street",
                        "addressLine2": "",
                        "city": "Ipswich",
                        "stateRegion": "MA",
                        "zipCode": "01938",
                        "country": "USA"
                    },
                    "categories": [
                        "0e3f9680-ab06-4565-af64-609b7364e6eb",
                        "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                        "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                        "56288fe8-8037-44da-8395-01d2d106dc54"
                    ],
                    "language": "en"
                }
            ],
            "urls": [
                {
                    "url": {
                        "value": "http://folio.org",
                        "description": ""
                    },
                    "language": "en-us",
                    "categories": [
                        "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                        "56288fe8-8037-44da-8395-01d2d106dc54"
                    ],
                    "notes": ""
                }
            ],
            "categories": [
                "08e0eb27-b57f-4638-a703-9a2c57bd8708",
                "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
                "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
                "ab18897b-0e40-4f31-896b-9c9adc979a88"
            ],
            "metadata": {
                "createdDate": "2018-05-19T00:00:00.000+0000",
                "createdByUserId": "16d1157c-d137-11e8-a8d5-f2801f1b9fd1"
            }
        }
    ],
    "totalRecords": 1
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

unable to list contacts -- malformed parameter 'query', syntax error at column 6

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to list contacts -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

POST /organizations-storage/contacts

Create a new contact item.

POST /organizations-storage/contacts
Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A contact record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this contact",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A phone number record",
        "properties": {
          "id": {
            "description": "UUID",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "phoneNumber": {
            "description": "The entire sequence of digits for this phone number",
            "type": "string"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization phone",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "description": "The type of this phone number",
            "type": "string",
            "enum": [
              "Office",
              "Mobile",
              "Fax",
              "Other"
            ]
          },
          "isPrimary": {
            "description": "Used to set this phone number as primary for the contact",
            "type": "boolean"
          },
          "language": {
            "description": "The language for this organization phone",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "phoneNumber"
        ]
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An email record",
        "properties": {
          "id": {
            "description": "The unique id of this email",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The value for this email",
            "type": "string"
          },
          "description": {
            "description": "The description for this email",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this email as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization email",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "description": "The language for this organization email",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An address record",
        "properties": {
          "id": {
            "description": "UUID",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "addressLine1": {
            "description": "The first line of this address",
            "type": "string"
          },
          "addressLine2": {
            "description": "The second line of this address",
            "type": "string"
          },
          "city": {
            "description": "The city for this address",
            "type": "string"
          },
          "stateRegion": {
            "description": "The state or region for this address",
            "type": "string"
          },
          "zipCode": {
            "description": "The zip code for this address",
            "type": "string"
          },
          "country": {
            "description": "The country for this address",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this address as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization address",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "description": "The language for this organization address",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A URL record",
        "properties": {
          "id": {
            "description": "The unique id of this url",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The value for this URL",
            "type": "string",
            "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
          },
          "description": {
            "description": "The description for this URL",
            "type": "string"
          },
          "language": {
            "description": "The language for this organization URL",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this url as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization URL",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "description": "The notes for this organization URL",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}

Example:

{
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ]
}

Response 201

Returns a newly created item, with server-controlled fields like 'id' populated

Headers
  • Location: required (string)

    URI to the created contact item

Body

Media type: application/json

Type: any

Example:

{
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ]
}

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to add contact -- malformed JSON at 13:3"

Response 401

Not authorized to perform requested action

Body

Media type: text/plain

Type: any

Example:

unable to create contacts -- unauthorized

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

GET /organizations-storage/contacts/{id}

Retrieve contact item with given {contactId}

GET /organizations-storage/contacts/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a Contact

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 200

Returns item with a given ID

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A contact record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this contact",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A phone number record",
        "properties": {
          "id": {
            "description": "UUID",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "phoneNumber": {
            "description": "The entire sequence of digits for this phone number",
            "type": "string"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization phone",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "description": "The type of this phone number",
            "type": "string",
            "enum": [
              "Office",
              "Mobile",
              "Fax",
              "Other"
            ]
          },
          "isPrimary": {
            "description": "Used to set this phone number as primary for the contact",
            "type": "boolean"
          },
          "language": {
            "description": "The language for this organization phone",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "phoneNumber"
        ]
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An email record",
        "properties": {
          "id": {
            "description": "The unique id of this email",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The value for this email",
            "type": "string"
          },
          "description": {
            "description": "The description for this email",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this email as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization email",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "description": "The language for this organization email",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An address record",
        "properties": {
          "id": {
            "description": "UUID",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "addressLine1": {
            "description": "The first line of this address",
            "type": "string"
          },
          "addressLine2": {
            "description": "The second line of this address",
            "type": "string"
          },
          "city": {
            "description": "The city for this address",
            "type": "string"
          },
          "stateRegion": {
            "description": "The state or region for this address",
            "type": "string"
          },
          "zipCode": {
            "description": "The zip code for this address",
            "type": "string"
          },
          "country": {
            "description": "The country for this address",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this address as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization address",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "description": "The language for this organization address",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A URL record",
        "properties": {
          "id": {
            "description": "The unique id of this url",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The value for this URL",
            "type": "string",
            "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
          },
          "description": {
            "description": "The description for this URL",
            "type": "string"
          },
          "language": {
            "description": "The language for this organization URL",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this url as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization URL",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "description": "The notes for this organization URL",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}

Example:

{
    "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
         
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ],
    "metadata": {
        "createdDate": "2018-05-19T00:00:00.000+0000",
        "createdByUserId": "16d1157c-d137-11e8-a8d5-f2801f1b9fd1"
    }
}

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator

DELETE /organizations-storage/contacts/{id}

Delete contact item with given {contactId}

DELETE /organizations-storage/contacts/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a Contact

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Response 204

Item deleted successfully

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to delete contact -- constraint violation"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

Internal server error, contact administrator

PUT /organizations-storage/contacts/{id}

Update contact item with given {contactId}

PUT /organizations-storage/contacts/{id}
URI Parameters
  • id: required (string - pattern: ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$)

    The UUID of a Contact

Query Parameters
  • lang: (string - default: en - pattern: [a-zA-Z]{2})

    Requested language. Optional. [lang=en]

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A contact record",
  "type": "object",
  "properties": {
    "id": {
      "description": "The unique id of this contact",
      "$schema": "http://json-schema.org/draft-04/schema#",
      "type": "string",
      "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
    },
    "prefix": {
      "description": "The prefix for this contact person",
      "type": "string"
    },
    "firstName": {
      "description": "The first name of this contact person",
      "type": "string"
    },
    "lastName": {
      "description": "The last name of this contact person",
      "type": "string"
    },
    "language": {
      "description": "The preferred language for this contact person",
      "type": "string"
    },
    "notes": {
      "description": "The notes for this contact person",
      "type": "string"
    },
    "phoneNumbers": {
      "id": "phoneNumbers",
      "description": "The list of phone numbers for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A phone number record",
        "properties": {
          "id": {
            "description": "UUID",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "phoneNumber": {
            "description": "The entire sequence of digits for this phone number",
            "type": "string"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization phone",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "type": {
            "description": "The type of this phone number",
            "type": "string",
            "enum": [
              "Office",
              "Mobile",
              "Fax",
              "Other"
            ]
          },
          "isPrimary": {
            "description": "Used to set this phone number as primary for the contact",
            "type": "boolean"
          },
          "language": {
            "description": "The language for this organization phone",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "phoneNumber"
        ]
      }
    },
    "emails": {
      "id": "emailAddresses",
      "description": "The list of emails for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An email record",
        "properties": {
          "id": {
            "description": "The unique id of this email",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The value for this email",
            "type": "string"
          },
          "description": {
            "description": "The description for this email",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this email as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization email",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "description": "The language for this organization email",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      }
    },
    "addresses": {
      "id": "addresses",
      "description": "The list of addresses for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An address record",
        "properties": {
          "id": {
            "description": "UUID",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "addressLine1": {
            "description": "The first line of this address",
            "type": "string"
          },
          "addressLine2": {
            "description": "The second line of this address",
            "type": "string"
          },
          "city": {
            "description": "The city for this address",
            "type": "string"
          },
          "stateRegion": {
            "description": "The state or region for this address",
            "type": "string"
          },
          "zipCode": {
            "description": "The zip code for this address",
            "type": "string"
          },
          "country": {
            "description": "The country for this address",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this address as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization address",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "description": "The language for this organization address",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false
      }
    },
    "urls": {
      "id": "urls",
      "description": "The list of URLs for this contact person",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "A URL record",
        "properties": {
          "id": {
            "description": "The unique id of this url",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "type": "string",
            "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
          },
          "value": {
            "description": "The value for this URL",
            "type": "string",
            "pattern": "^$|(([Hh][Tt][Tt][Pp]|[Ff][Tt][Pp])([Ss])?://.+$)"
          },
          "description": {
            "description": "The description for this URL",
            "type": "string"
          },
          "language": {
            "description": "The language for this organization URL",
            "type": "string"
          },
          "isPrimary": {
            "description": "Used to set this url as primary for the contact",
            "type": "boolean"
          },
          "categories": {
            "id": "categories",
            "description": "The list of categories for this organization URL",
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "notes": {
            "description": "The notes for this organization URL",
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "readonly": true,
            "$schema": "http://json-schema.org/draft-04/schema#",
            "title": "Metadata Schema",
            "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
            "properties": {
              "createdDate": {
                "description": "Date and time when the record was created",
                "type": "string",
                "format": "date-time"
              },
              "createdByUserId": {
                "description": "ID of the user who created the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "createdByUsername": {
                "description": "Username of the user who created the record (when available)",
                "type": "string"
              },
              "updatedDate": {
                "description": "Date and time when the record was last updated",
                "type": "string",
                "format": "date-time"
              },
              "updatedByUserId": {
                "description": "ID of the user who last updated the record (when available)",
                "type": "string",
                "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
              },
              "updatedByUsername": {
                "description": "Username of the user who last updated the record (when available)",
                "type": "string"
              }
            },
            "additionalProperties": false,
            "required": [
              "createdDate"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "value"
        ]
      }
    },
    "categories": {
      "id": "contactCategory",
      "description": "The list of contact categories associated with this organization contact person",
      "type": "array",
      "items": {
        "description": "UUID of the contact category",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "string",
        "pattern": "^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-5][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$"
      }
    },
    "inactive": {
      "description": "Used to indicate that a contact is no longer active",
      "type": "boolean",
      "default": false
    },
    "metadata": {
      "type": "object",
      "readonly": true,
      "$schema": "http://json-schema.org/draft-04/schema#",
      "title": "Metadata Schema",
      "description": "Metadata about creation and changes to records, provided by the server (client should not provide)",
      "properties": {
        "createdDate": {
          "description": "Date and time when the record was created",
          "type": "string",
          "format": "date-time"
        },
        "createdByUserId": {
          "description": "ID of the user who created the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "createdByUsername": {
          "description": "Username of the user who created the record (when available)",
          "type": "string"
        },
        "updatedDate": {
          "description": "Date and time when the record was last updated",
          "type": "string",
          "format": "date-time"
        },
        "updatedByUserId": {
          "description": "ID of the user who last updated the record (when available)",
          "type": "string",
          "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
        },
        "updatedByUsername": {
          "description": "Username of the user who last updated the record (when available)",
          "type": "string"
        }
      },
      "additionalProperties": false,
      "required": [
        "createdDate"
      ]
    }
  },
  "additionalProperties": false,
  "required": [
    "firstName",
    "lastName"
  ]
}

Example:

{
    "id": "08e0eb27-b57f-4638-a703-9a2c57bd8708",
    "prefix": "Director",
    "firstName": "Nick",
    "lastName": "Fury",
    "language": "en-us",
    "notes": "SHIELD's Big Kahuna",
    "inactive": false,
    "phoneNumbers": [
     {
         "phoneNumber": "19789999999",
         "categories": [
             "0e3f9680-ab06-4565-af64-609b7364e6eb",
             "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6"
         ],
         "language": "en-us",
         "type": "Office",
         "isPrimary": true
         
        }
    ],
    "emails": [
        {
            "email": {
                "value": "noreply@folio.org",
                "description": "Main"
            },
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en-us"
        }
    ],
    "addresses": [
        {
            "address": {
                "addressLine1": "10 Estes Street",
                "addressLine2": "",
                "city": "Ipswich",
                "stateRegion": "MA",
                "zipCode": "01938",
                "country": "USA"
            },
            "categories": [
                "0e3f9680-ab06-4565-af64-609b7364e6eb",
                "996ecd31-7ca4-4d8d-9bbf-bc94dff5f6c6",
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "language": "en"
        }
    ],
    "urls": [
        {
            "url": {
                "value": "http://folio.org",
                "description": ""
            },
            "language": "en-us",
            "categories": [
                "112ae2e4-88ae-4fa5-a75b-2379d2035e52",
                "56288fe8-8037-44da-8395-01d2d106dc54"
            ],
            "notes": ""
        }
    ],
    "categories": [
        "08e0eb27-b57f-4638-a703-9a2c57bd8708",
        "a5da9c44-6619-403f-bd3b-f9bd2f63bc59",
        "da0272e4-7ff7-4ea8-9bc9-9d9cd5c81580",
        "ab18897b-0e40-4f31-896b-9c9adc979a88"
    ],
    "metadata": {
        "createdDate": "2018-05-19T00:00:00.000+0000",
        "createdByUserId": "16d1157c-d137-11e8-a8d5-f2801f1b9fd1"
    }
}

Response 204

Item successfully updated

Response 400

Bad request, e.g. malformed request body or query parameter. Details of the error (e.g. name of the parameter or line/character number with malformed data) provided in the response.

Body

Media type: text/plain

Type: any

Example:

"unable to update contact -- malformed JSON at 13:4"

Response 404

Item with a given ID not found

Body

Media type: text/plain

Type: any

Example:

"contact not found"

Response 422

Validation errors

Body

Media type: application/json

Type: json

Content:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A set of errors",
  "type": "object",
  "properties": {
    "errors": {
      "description": "List of errors",
      "id": "errors",
      "type": "array",
      "items": {
        "type": "object",
        "$schema": "http://json-schema.org/draft-04/schema#",
        "description": "An error",
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message text"
          },
          "type": {
            "type": "string",
            "description": "Error message type"
          },
          "code": {
            "type": "string",
            "description": "Error message code"
          },
          "parameters": {
            "type": "object",
            "description": "Error message parameters",
            "$schema": "http://json-schema.org/draft-04/schema#",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              }
            }
          }
        },
        "required": [
          "message"
        ]
      }
    },
    "total_records": {
      "description": "Total number of errors",
      "type": "integer"
    }
  }
}

Example:

{
  "errors": [
    {
      "message": "may not be null",
      "type": "1",
      "code": "-1",
      "parameters": [
        {
          "key": "moduleTo",
          "value": "null"
        }
      ]
    }
  ]
}

Response 500

Internal server error, e.g. due to misconfiguration

Body

Media type: text/plain

Type: any

Example:

internal server error, contact administrator