Skip to content

Duplicate a job preset

Open .md

POST/v1/api/store/{team_slug}/setting/job_preset/{hash_id}/duplicate

v1Operation ID v1_public_job_preset_duplicate

Copies a job preset to the end of the list, named like it with " (copy)" added (the original name is shortened if the result would pass 191 characters).

The copy gets the note, the service lines, the tasks, the people still on your team, and the files. Copied files share the stored file with the original and keep their links to the copied service lines. People who were deleted or left your team are not copied.

It takes no body. Returns the new preset.

Permission

Needs the Manage Settings permission. The team owner always has it.

Business rules

  • Deleted services, locations and task presets are copied as they are, so a preset that needs review gives a copy that needs review too.

Side effects

  • Team members who have YoPrint open see the new preset at once.

Path parameters

  • team_slugstringrequired

    Your team slug, shown as Team ID next to your API key in Profile.

    • Example your-team
  • hash_idstringrequired

    The job preset to copy. Its hash id from an earlier answer; there is no unique key for it.

    • Example 8vxTyCrd1y1gdf

Request body

This operation takes no request body.

Response

200Successful response.

  • dataobjectrequired
    Child fields (12)
    • assigned_usersarray of objectsrequired

      The people on the job itself. Jobs made from the preset get the ones still on your team.

      Fields of each item (4)
      • avatar_urlstring | nullrequired

        Their profile picture, or null.

      • idstringrequired
      • namestringrequired
      • removedbooleanrequired

        True when the person was deleted or is no longer on your team. They stay listed until someone takes them off; jobs made from the preset leave them out.

    • idstringrequired
    • is_validbooleanrequired

      False when a service, saved location, or task preset it uses was deleted, or a service option no longer exists.

    • mockuparray of objectsrequired

      Mockup images, in their order.

      Fields of each item (19)
      • collectionstringrequired
        • One of: "mockup", "production_file"
      • created_atstring (date-time)required

        When the file record was made: the upload time, or for a duplicated preset, when it was copied.

      • custom_propertiesobject | arrayrequired
      • file_namestringrequired
      • idstringrequired

        The file's id: use it in update and delete file rows.

      • is_imagebooleanrequired
      • job_preset_idstringrequired

        The preset the file belongs to.

      • job_servicearray of stringsrequired

        The ids of this preset's service lines the file belongs to. A job made from the preset links its copy to the matching new services.

      • mime_typestring | nullrequired
      • namestring | nullrequired

        The display name.

      • positioninteger | nullrequired

        Where the file sorts, lowest first.

      • previewobject | nullrequired

        Preview image links small, medium and large (250, 800 and 1200 px), or null when there is no preview.

      • show_in_pdfboolean | nullrequired

        Null when it was never set.

      • sizeintegerrequired

        Bytes.

      • source_media_idnullrequired

        Always null on a preset's files.

      • urlstring | nullrequired

        Where to download the file.

      • view_urlstring | nullrequired

        A signed link to view the file. It expires: read it fresh, and don't store it.

      • dimensionsobject | null

        Pixel size of an image, read from its header; null for other files and for images uploaded before the size was recorded.

        Child fields (2)
      • ready: the preview links work. processing: an image over 10 MB whose stored preview a worker is still making (seconds); read the file again, or in the web app wait for media.preview_state_changed on the team channel. too_large: an image over 120 megapixels; it never gets a preview. failed: the worker gave up. none: not an image.

        • One of: "ready", "processing", "too_large", "failed", "none"
    • namestringrequired
    • needs_reviewbooleanrequired

      True when the preset needs review (shown as "Needs review" in the web app):

      • is_valid is false (a service, service option, saved location, or task preset was deleted)
      • A team member assigned to one of its tasks was deleted or left the team (assignees on the job itself do not trigger review)

      A preset that needs review still saves. Creating a job from it omits missing tasks and removed teammates.

    • notestring | nullrequired
    • pipelinearray of objectsrequired

      The tasks.

      Fields of each item (11)
      • assigned_usersarray of objects
      • idstring
      • is_validboolean
      • namestring | null
      • notestring | null
      • pipelineobject | null

        The task preset it follows, as GET /v1/api/store/{team_slug}/setting/pipeline/{hash_id} returns it: id, label, color, version, enable, trashed, and its statuses (deleted ones included).

        Child fields (7)
        • colorstring
        • enableboolean
        • idstring
        • labelstring
        • statusesarray of objects
          Fields of each item (9)
          • colorstringrequired
          • customer_labelstringrequired

            What customers see in the customer portal. When none is set: Pending for start, In Progress for in_progress and pre_production, Completed for end.

          • idstringrequired
          • labelstringrequired
          • positionintegerrequired

            Sort order within the list, lowest first.

          • rolestringrequired

            Which list the status belongs to:

            • order: sales orders
            • quote: quotes
            • job: jobs
            • purchase_order: purchase orders
            • shipment: shipments
            • customer_message: message threads
            • pipeline: tasks within a task preset
            • One of: "order", "quote", "job", "purchase_order", "shipment", "customer_message", "pipeline"
          • trashedbooleanrequired

            True for a deleted status. Only the full list includes deleted ones.

          • typestringrequired

            The stage of the status in the workflow: start (first status in the list), pre_production, in_progress, or end (final status).

            • One of: "start", "pre_production", "in_progress", "end"
          • The task preset, for pipeline statuses only. Absent for every other role.

        • trashedboolean
        • versioninteger
      • pipeline_colorstring | null

        The task preset's color.

      • pipeline_namestring | null

        The task preset's name.

      • positioninteger

        0 when none was sent.

      • trashedboolean

        True when its task preset was deleted.

    • positionstringrequired

      Sort order within the preset list, lowest first. A decimal string, such as "1.0000000000000000"; parse it as a decimal.

    • production_filearray of objectsrequired

      Production files, in their order.

    • servicearray of objectsrequired

      The service lines.

      Fields of each item (11)
      • versioninteger
        • Always 1
      • customer_notestring | null
      • idstring
      • locationobject

        type, display_name and trashed (true when a saved location was deleted), plus id for a saved location or name for a custom one.

      • notestring | null
      • optionstring | null
      • positioninteger
      • review_reasonstring | null

        Why the line needs review: its service was deleted, the service no longer has this option, or its saved location was deleted. Null when the line is fine.

        • One of: "service_removed", "option_removed", "location_removed"
      • service_namestring | null
      • validboolean

        False when review_reason is set.

    • updated_atstring (date-time) | nullrequired

      When the preset was last edited ("Last edited" in the web app). Every save changes it, even one that changes only its lines; reordering presets doesn't.

  • statusintegerrequired
  • successbooleanrequired

Errors

  • 401The API key is missing or wrong (unauthenticated).

  • 403You are not allowed to do this. api_access_not_in_plan: your team's plan doesn't include API access (Pro and above, with an active subscription or trial), so every request answers this until the team upgrades. When your role lacks the permission the operation needs, the body is only {"message": "Insufficient Permission"}. Other refusals use the error envelope, with unauthorized or user_is_not_authorized.

    When
    Your role lacks Manage Settings. The body is {"message": "Insufficient Permission"}, without the error envelope.
    Fix
    Use the key of a member whose role has Manage Settings, or the owner's.
  • 404Not found. page_not_found: the team slug is unknown, you are not a member of the team, or an id in the path is not one of this team's. code: null, with a message that starts "No query results for": there is no record with that id.

    When
    No job preset of your team has this id. error.code is null; error.message names the record type.
    Fix
    Use an id from the list.
  • 422The request was refused and changed nothing. validation_failed lists what to fix in error.fields; other codes name a business rule, explained in error.message. A few checks answer with only {"message": "..."}. An operation that calls another service (a payment provider, a carrier, an accounting app) can answer connect_timeout ("Please retry again") when that service does not answer in time: the change may or may not have happened there, so read the record back before you retry.

    When
    A service, saved location or task preset the preset points to can't be found for your team, not even among deleted ones: error.code job_validation_error, such as "Service not found!". Nothing is copied.
    Fix
    Edit the preset to remove that line, then try again.