client.files.post

A method of the Files endpoint.

post(name: str, *, expires_at: str = None, description: str = None) Response

Initiate an upload of a file into the platform

API URL: POST /files

import civis
client = civis.APIClient()
response = client.files.post(...)
Parameters:
namestr

The file name.

expires_atstr (date-time), optional

The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

descriptionstr, optional

The user-defined description of the file.

Returns:
civis.Response
  • idint

    The ID of the file.

  • namestr

    The file name.

  • created_atstr (date-time)

    The date and time the file was created.

  • file_sizeint

    The file size.

  • expires_atstr (date-time)

    The date and time the file will expire. If not specified, the file will expire in 30 days. To keep a file indefinitely, specify null.

  • descriptionstr

    The user-defined description of the file.

  • upload_urlstr

    The URL that may be used to upload a file. To use the upload URL, initiate a POST request to the given URL with the file you wish to import as the “file” form field.

  • upload_fieldscivis.Response

    A hash containing the form fields to be included with the POST request.

  • my_permission_levelstr

    Your permission level on the object. One of “read”, “write”, or “manage”.