API
⌘K
My Developer Account

File Uploads

Upload a file by making a POST request to https://upload.planningcenteronline.com/v2/files. Your request should use multipart/form-data encoding and contain a file attribute with the file data. Here's how to upload a file with curl:

curl -u app_id:secret -X POST -F 'file=@/path/to/file.png' https://upload.planningcenteronline.com/v2/files

The response you get will contain an id which is the file UUID.

{
  "data": [
    {
      "type": "File",
      "id": "us1-16207df7-b6cc-4abe-ca1a-306c6f7e423d",
      "attributes": {
        "source_ip": "70.128.100.145",
        "md5": "e178604e5083cc23782f34650a49b025",
        "content_type": "image/png",
        "file_size": 48341,
        "name": "file.png",
        "expires_at": "2016-05-23T23:13:32Z"
      }
    }
  ]
}

Pass the UUID as the attribute value to an endpoint that accepts a file. The UUID is a string that tells the endpoint which file to associate.

To assign the file to an attribute, pass the UUID as a string. For example, here is how to update the Person avatar:

curl -u app_id:secret -X PATCH https://api.planningcenteronline.com/people/v2/people/1 -d '{"data":{"attributes":{"avatar":"us1-16207df7-b6cc-4abe-ca1a-306c6f7e423d"}}}'