Dela via


Document Models - Copy Model To

Copies document model to the target resource, region, and modelId.

POST {endpoint}/documentintelligence/documentModels/{modelId}:copyTo?api-version=2024-11-30

URI Parameters

Name In Required Type Description
endpoint
path True

string

uri

The Document Intelligence service endpoint.

modelId
path True

string

Unique document model name.

Regex pattern: ^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
accessToken True

string

Token used to authorize the request.

expirationDateTime True

string

Date/time when the access token expires.

targetModelId True

string

Identifier of the target document model.

targetModelLocation True

string

URL of the copied document model in the target account.

targetResourceId True

string

ID of the target Azure resource where the document model should be copied to.

targetResourceRegion True

string

Location of the target Azure resource where the document model should be copied to.

Responses

Name Type Description
202 Accepted

The request has been accepted for processing, but processing has not yet completed.

Headers

  • Operation-Location: string
  • Retry-After: integer
Other Status Codes

DocumentIntelligenceErrorResponse

An unexpected error response.

Security

Ocp-Apim-Subscription-Key

Type: apiKey
In: header

OAuth2Auth

Type: oauth2
Flow: accessCode
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize
Token URL: https://login.microsoftonline.com/common/oauth2/token

Scopes

Name Description
https://cognitiveservices.azure.com/.default

Examples

Copy Document Model To

Sample request

POST https://myendpoint.cognitiveservices.azure.com/documentintelligence/documentModels/sourceModel:copyTo?api-version=2024-11-30

{
  "targetResourceId": "/subscriptions/targetSub/resourceGroups/targetRG/providers/Microsoft.CognitiveServices/accounts/targetService",
  "targetResourceRegion": "targetResourceRegion",
  "targetModelId": "targetModel",
  "targetModelLocation": "https://targetEndpoint.cognitiveservices.azure.com/documentintelligence/documentModels/targetModel",
  "accessToken": "accessToken",
  "expirationDateTime": "2021-09-23T09:12:54.552Z"
}

Sample response

Operation-Location: https://myendpoint.cognitiveservices.azure.com/documentintelligence/operations/b704bb00-d130-4f3f-a1d8-ca96de3eabb4?api-version=2024-11-30

Definitions

Name Description
DocumentIntelligenceError

The error object.

DocumentIntelligenceErrorResponse

Error response object.

DocumentIntelligenceInnerError

An object containing more specific information about the error.

ModelCopyAuthorization

Authorization to copy a document model to the specified target resource and modelId.

DocumentIntelligenceError

The error object.

Name Type Description
code

string

One of a server-defined set of error codes.

details

DocumentIntelligenceError[]

An array of details about specific errors that led to this reported error.

innererror

DocumentIntelligenceInnerError

An object containing more specific information than the current object about the error.

message

string

A human-readable representation of the error.

target

string

The target of the error.

DocumentIntelligenceErrorResponse

Error response object.

Name Type Description
error

DocumentIntelligenceError

Error info.

DocumentIntelligenceInnerError

An object containing more specific information about the error.

Name Type Description
code

string

One of a server-defined set of error codes.

innererror

DocumentIntelligenceInnerError

Inner error.

message

string

A human-readable representation of the error.

ModelCopyAuthorization

Authorization to copy a document model to the specified target resource and modelId.

Name Type Description
accessToken

string

Token used to authorize the request.

expirationDateTime

string

Date/time when the access token expires.

targetModelId

string

Identifier of the target document model.

targetModelLocation

string

URL of the copied document model in the target account.

targetResourceId

string

ID of the target Azure resource where the document model should be copied to.

targetResourceRegion

string

Location of the target Azure resource where the document model should be copied to.